https://github.com/willklein/eslint-plugin-disallow-methods
ESLint plugin for disallowing specified methods
https://github.com/willklein/eslint-plugin-disallow-methods
Last synced: about 1 year ago
JSON representation
ESLint plugin for disallowing specified methods
- Host: GitHub
- URL: https://github.com/willklein/eslint-plugin-disallow-methods
- Owner: willklein
- License: mit
- Created: 2015-08-03T09:11:49.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-07T05:30:18.000Z (almost 11 years ago)
- Last Synced: 2025-04-18T00:01:01.736Z (about 1 year ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-disallow-methods
> ESLint plugin for disallowing specified methods
## Usage
This plugin requires ESLint to also be installed. With both ESLint and this plugin installed, you will need to enable the plugin and configure what methods are disallowed.
### Installation
Install ESLint if you have not already:
npm install eslint
Install the plugin:
npm install eslint-plugin-disallow-methods
### Configuration
Configure the plugin and its rules in your `.eslintrc` file or your shareable config.
Sample `.eslintrc`:
{
"plugins": [
// other plugins would go here
"disallow-methods"
],
rules: {
// other rules here
// disallow-methods rules
"disallow-methods/disallow-methods": [2, [
{
"object": "protectedObject",
"method": "disallowedMethod"
},
{
"object": "anotherProtectedObject",
"method": "anotherDisallowedMethod"
}
]]
}
}
Configuring rule to `1` will set it to warn and configuring it to `2` will set it to error.
## Under Development
This plugin is under active development and its API may change at any time.
## License
[MIT](http://mit-license.org/) © [Will Klein](http://willkle.in)