Skip to content

Latest commit

 

History

History
142 lines (94 loc) · 3.46 KB

README.md

File metadata and controls

142 lines (94 loc) · 3.46 KB

textlint-rule-aws-service-name

codecov

Important: This is not an official AWS service. This is a personal project by a single user.

textlint rule for AWS product Names.

This is a textlint rule to check for inconsistencies in AWS service and product names.

It detects inconsistencies as shown below (image shows usage with VSCode extension):

lintImage

This project is heavily influenced by the following repository:

I would like to express my deep respect to @37108 who has been developing this mechanism since as early as 2019!

https://github.com/37108/textlint-rule-aws-spellcheck

Features

What it can do

  • Detect capitalization inconsistencies
    • Ec2 -> EC2
  • Detect missing spaces in service names that require them
    • SecurityHub -> Security Hub
  • Detect unnecessary spaces in service names that should not have them
    • Cloud Front -> CloudFront
  • Detect incorrect prefixes between Amazon and AWS
    • AWS EC2 -> Amazon EC2
    • Amazon Security Hub -> AWS Security Hub

For Developers and Contributors

Please refer to this file:

CONTRIBUTING.md

Install

Install with npm:

npm install textlint-rule-aws-service-name

Usage

Using with textlintrc

After installation, add the following to your .textlintrc.json:

{
    "rules": {
        "aws-service-name": true
    }
}

If you're using yml (yaml) format like .textlinrc.yml, write it as follows:

rules:
  aws-service-name: true

Using with CLI

After installation, you can also run it via CLI as follows:

textlint --rule aws-service-name README.md

Using with VSCode

After setting up textlintrc, please install the extension by referring to the article below:

https://qiita.com/takasp/items/22f7f72b691fda30aea2

Important Note

As mentioned in the official textlint GitHub, errors will occur if the installation locations of textlint and the rules differ:

https://github.com/textlint/textlint/blob/master/docs/faq/failed-to-load-textlints-module.md

# NG
npm i -g textlint
npm i textlint-rule-aws-service-name --save-dev
# OK
npm i -g textlint
npm i -g textlint-rule-aws-service-name

Build

Builds source codes for publish to the lib folder. You can write ES2015+ source codes in src/ folder.

yarn build

Tests

The following is a list of test files to be placed in their respective directories:

  • The test/ directory places the files for testing the texlint rules in src/index.ts. (*index.ts)
  • specs/ directory places the tests for the processing group to generate the yml files for textlint rules under src/. (*spec.ts)

To test them, run the following command:

yarn test
# or npm run test

You can also test each test file by running the following:

# Run only the test files under specs/.
yarn jest
# or npm run jest
# run only test files under test/.
yarn testLint
# or npm run testLint

License

MIT © bun913