@wxcc-desktop/eslint-plugin-no-blocked-words-plugin

1.0.4 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @wxcc-desktop/eslint-plugin-no-blocked-words-plugin

Weekly Downloads

27

Version

1.0.4

License

ISC

Unpacked Size

3.7 kB

Total Files

4

Last publish

Collaborators

  • molker
  • aigoel
  • rathnavel
  • vshanbha
  • parag.somani
  • prak28
  • vinitkumargoel
  • mmeraj