GitXplorerGitXplorer
L

eslint-plugin-i18n-checker

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
4b2674145e9b85d93255884132b9a934e28132c0

chore: rename

committed 3 years ago
Unverified
59c08d59356a10667da511719e84c1120ebe34b0

chore: update comment

committed 3 years ago
Unverified
78ae6e835917b0285bb53ed8a079358f885bf4ee

chore: remove .idea

committed 3 years ago
Unverified
04df5d450c2a751396746b4066939be5702b5e97

chore: bump to v1.2.1

committed 3 years ago
Unverified
f8e3d2fc19084ea80640e587bd2221c00a93147b

fix: load json

committed 3 years ago
Unverified
320bfadc09216ec47d926801e6c2d5578fd1b9e9

chore: upgrade to v1.2.0

committed 3 years ago

README

The README file for this repository.

eslint-plugin-i18n-checker

Check i18n keys existence

Installation

You"ll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-i18n-checker:

npm install eslint-plugin-i18n-checker --save-dev

Usage

Add i18n-checker to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "i18n-checker"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
      "i18n-checker/json-key-exists": [
        2,
        {
          "functionNames": [
            "i18n.t",
            "t"
          ],
          "localesPath": "public/locales",
          "specifics": [
            {
              "matcher": "^global:(.*)$",
              "to": "global.json"
            },
            {
              "matcher": "^(.*)$",
              "to": "app.json"
            }
          ]
        }
      ],
      "i18n-checker/key-must-be-literal": [
        1,
        {
          "functionNames": ["i18n.t", "t"]
        }
      ],
      "i18n-checker/no-literal-in-jsx": [
        1,
        {
          "allowList": ["-"]
        }
      ]
    }
}

Supported Rules

  • json-key-exists
  • key-must-be-literal
  • no-literal-in-jsx