0.6.0 β’ Published 4 months ago
eslint-plugin-nitpick v0.6.0
eslint-plugin-nitpick
Nitpicky ESLint rules.
Installation
npm install -D eslint eslint-plugin-nitpick
Configuration
Old (.eslintrc.*
)
module.exports = {
// ...
plugins: [
// ...
"nitpick",
],
extends: [
// ...
"nitpick/recommended",
],
};
New (eslint.config.js
)
Either use one of the configs in eslint-plugin-nitpick/lib/configs
or import the plugin as a standalone from eslint-plugin-nitpick
.
const nitpickRecommended = require("eslint-plugin-nitpick/lib/configs/recommended");
module.exports = {
// ...
...nitpickRecommended,
};
Rules
πΌ Configurations enabled in.\
π Set in the all
configuration.\
β
Set in the recommended
configuration.\
π§ Automatically fixable by the --fix
CLI option.\
π‘ Manually fixable by editor suggestions.
NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β | Description | πΌ | π§ | π‘ |
---|---|---|---|---|
no-redundant-vars | Warns against variables that are returned without any other usage | π β | π‘ | |
no-useless-interpolation | Warns against template-literal interpolation with a literal | π β | π§ | π‘ |
no-useless-rest | Warns against using a rest element without destructuring other properties/elements | π β | π‘ | |
prefer-if-conditionals | Prefer an if statement to using logical operators (?: , && or \|\| ) in expressions | π β | π§ | π‘ |
Configs
Name | |
---|---|
π | all |
β | recommended |