3.1.0 • Published 12 months ago
@annangela/eslint-plugin-prefer-reflect v3.1.0
eslint-plugin-prefer-reflect
Main propose:
- Modern version of original
prefer-reflectrules in eslint
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install @annangela/eslint-plugin-prefer-reflect:
npm install @annangela/eslint-plugin-prefer-reflect --save-devUsage
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.