Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/darwintantuco/eslint-plugin-detect-bad-words
Detect bad/profanity words in code
https://github.com/darwintantuco/eslint-plugin-detect-bad-words
Last synced: 18 days ago
JSON representation
Detect bad/profanity words in code
- Host: GitHub
- URL: https://github.com/darwintantuco/eslint-plugin-detect-bad-words
- Owner: darwintantuco
- License: mit
- Created: 2020-08-04T09:41:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-29T00:38:11.000Z (over 1 year ago)
- Last Synced: 2024-04-26T06:54:04.331Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 413 KB
- Stars: 17
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-detect-bad-words
![Node.js CI](https://github.com/darwintantuco/eslint-plugin-detect-bad-words/workflows/Node.js%20CI/badge.svg?branch=master)
Detect bad/profanity words in code
Uses [badwords](https://github.com/MauriceButler/badwords) under the hood
![](demo.png)
## Installation
You'll first need to install [ESLint](http://eslint.org):
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:
```json
{
"plugins": ["detect-bad-words"]
}
```Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"detect-bad-words/in-code": "error",
"detect-bad-words/in-comment": "error"
}
}
```### Optional
You can define custom bad words under settings section.
```json
{
"settings": {
"customBadWords": ["wtf", "fck", "sht"]
}
}
```## License
MIT