1.0.3 • Published 2 years ago

eslint-plugin-no-blocked-words-plugin v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

eslint-plugin-no-blocked-words-plugin

  • This custom ESLint plugin is used to disallow the use of certain words which might be insensitive or blocked due to security policies.
  • This will detect the words used as any type of identifiers or strings and throw an error when the blocked words are used at any place in the code.
  • It takes an array of strings which you want to block from your code.

Table of Contents

  1. Installation and Configuration
  2. Usage

Installation and Configuration

yarn add --dev eslint eslint-plugin-no-blocked-words-plugin

Note: If you installed ESLint globally then you must also install eslint-plugin-no-blocked-words-plugin globally.

Usage

  • Add the plugin name in the plugins array of .eslintrc.js file of your Project directory like this:
  {
    "plugins": ["eslint-plugin-no-blocked-words-plugin"]
  }
  • Add this rule in rules section of .eslintrc.js file of your Project directory like this:
{
  "rules": {
"no-blocked-words-plugin/no-blocked-words": ["error", ["blockedWord1", "blockedWord2"]]
  }
}
  • Run yarn eslint and the Project code will be analyzed for any words containing these strings and eslint will fail showing the errors.
  • This will also detect the words containing these strings like the word SomethingblockedWord1Something will also throw error.
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago