textlint-rule-aws-service-name
TypeScript icon, indicating that this package has built-in type declarations

1.9.0 • Public • Published

textlint-rule-aws-service-name

codecov

重要: AWS公式のサービスではありません。1ユーザーの活動です。

Important: This Project is UnOffical.

textlint rule for AWS product Names.

AWSのサービス名やプロダクト名の表記揺れをチェックするためのtexlintのルールです。

以下のように表記揺れを検出します。(画像はVSCodeの拡張機能を利用)

lintImage

このプロジェクトは以下のリポジトリの影響をモロに受けています。

2019年という早い段階から仕組みづくりをされている @37108氏に強いリスペクトを表明いたします!

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

できること・できないこと

できること

  • 大文字・小文字の表記揺れの検出
    • Ec2 -> EC2
  • 本来スペースが必要なサービスにスペースがないことを検出
    • SecurityHub -> Security Hub
  • 本来スペースが不要なサービスにスペースがあることを検出
    • Cloud Front -> CloudFront
  • AmazonAWS の接頭辞の間違い検出
    • AWS EC2 -> Amazon EC2
    • Amazon Security Hub -> AWS Security Hub

開発者・コントリビュータの皆様へ

こちらのファイルをご参照ください。

CONTRIBUTING.md

Install

Install with npm:

npm install textlint-rule-aws-service-name

Usage

textlintrcを利用する場合

Installの後に.textlintrc.jsonに以下のように記述します。

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

.textlinrc.ymlのようにyml(yaml)の場合は以下のように記載します。

rules:
  aws-service-name: true

CLIで使う場合

Installの後に以下のようにCLIでも実行できます。

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

VSCodeで利用する場合

textlintrcを設定の上、以下記事を参考に拡張機能を導入してください。

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

注意事項

以下textlint公式のGitHubにも記載がありますが、textlintのインストール場所とルールのインストール場所が異なる場合はエラーがでます。

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

Readme

Keywords

Package Sidebar

Install

npm i textlint-rule-aws-service-name

Weekly Downloads

231

Version

1.9.0

License

MIT

Unpacked Size

89.6 kB

Total Files

9

Last publish

Collaborators

  • bun913