1.0.2 • Published 5 months ago

@zohodesk/eslint-plugin-no-hardcoding v1.0.2

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

eslint-plugin-no-hardcoding

To prevent hardcoding content and to enforce usage of appropriate i18n keys

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-no-hardcoding:

$ npm install eslint-plugin-no-hardcoding --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-no-hardcoding globally.

Usage

Add @zohodesk/no-hardcoding to the plugins section of your .eslintrc configuration file.

{
  "plugins": ["@zohodesk/no-hardcoding"]
}

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

{
  "rules": {
    "@zohodesk/no-hardcoding/no-hardcoding": 2,
    "@zohodesk/no-hardcoding/use-getI18NValue-method-appropriately": 2
  }
}

Note: For the working of no-hardcoding rule of this plugin a properties file of name noHardcodingRuleExcludes.properties should be present in the location build/eslint in the root dirctory of the project.

Note: For the working of use-getI18NValue-method-appropriately rule of this plugin a properties file of name getI18NValueEslintRuleExcludes.properties should be present in the location build/eslint in the root dirctory of the project.

List of supported rules

  • @zohodesk/no-hardcoding/no-hardcoding,
  • @zohodesk/no-hardcoding/use-getI18NValue-method-appropriately
1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

6 months ago