包详细信息

eslint-plugin-detect-bad-words

darwintantuco20.7kMIT1.0.7

Detect bad/profanity words in code

eslint, eslintplugin, eslint-plugin, profane

自述文件

eslint-plugin-detect-bad-words

Node.js CI

Detect bad/profanity words in code

Uses badwords under the hood

Installation

You'll first need to install ESLint:

Next, install eslint-plugin-detect-bad-words:

npm

$ npm install eslint-plugin-detect-bad-words --save-dev

yarn

$ yarn add eslint-plugin-detect-bad-words --dev

Usage

Add detect-bad-words to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["detect-bad-words"]
}

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

{
  "rules": {
    "detect-bad-words/in-code": "error",
    "detect-bad-words/in-comment": "error"
  }
}

Optional

You can define custom bad words under settings section.

{
  "settings": {
    "customBadWords": ["wtf", "fck", "sht"]
  }
}

License

MIT

更新日志

Changelog

All changes on this project will be documented in this file.

[1.0.7] - January 23, 2021

  • More strict typescript config
  • Remove unused eslint plugins

[1.0.6] - January 11, 2021

  • Fix compilation issue

[1.0.5] - January 11, 2021

  • Initial release
  • Rename package from eslint-plugin-detect-unwanted-words to eslint-plugin-detect-bad-words
  • Publish eslint-plugin-detect-bad-words
  • Deprecate eslint-plugin-detect-unwanted-words
  • Use badwords under the hood
  • Detect bad words on identifiers
  • Configure eslint
  • Configure typescript

eslint-plugin-detect-unwanted-words

  • deprecated
  • previous package name

[1.0.4] - August 5, 2020

  • Optimize search logic

[1.0.3] - August 5, 2020

  • Fix bug when unwantedWords contains an item with multiple words

[1.0.2] - August 5, 2020

  • Minor improvements, handle both lowercase and uppercase

[1.0.1] - August 4, 2020

  • Use regex when checking for unwanted words

[1.0.0] - August 4, 2020

  • Initial release