@annangela/eslint-plugin-prefer-reflect
v3.1.0
Published
Modern version of original "prefer-reflect" rules in eslint
Downloads
344
Maintainers
Readme
eslint-plugin-prefer-reflect
Main propose:
- Modern version of original
prefer-reflect
rules in eslint
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install @annangela/eslint-plugin-prefer-reflect
:
npm install @annangela/eslint-plugin-prefer-reflect --save-dev
Usage
eslint.config.js
- flat config
Use the plugin:
import preferReflectPlugin from "@annangela/eslint-plugin-prefer-reflect";
// ...
export default {
// ...
plugins: {
// ...
"@annangela/prefer-reflect": preferReflectPlugin,
// ...
},
rules: {
// ...
// @annangela/prefer-reflect
"@annangela/prefer-reflect/prefer-reflect": "error",
// ...
},
};
.eslintrc
(Deprecated)
Add @annangela/eslint-plugin-prefer-reflect
to the plugins section of your .eslintrc
configuration file:
{
"plugins": [
"@annangela/prefer-reflect"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@annangela/prefer-reflect/prefer-reflect": "error"
}
}
I know this repeated words looks stupid, but the eslint requires this format.
Supported Rules
@annangela/prefer-reflect/prefer-reflect
: Please look up the doc link.