0.0.1 • Published 4 years ago
eslint-plugin-destructure-check v0.0.1
eslint-plugin-destructure-check
Deconstruction assignment check, including depth and must-default
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-destructure-check:
$ npm install eslint-plugin-destructure-check --save-devUsage
Add destructure-check to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"destructure-check"
]
}To customize the allowed destructuring depth and ignore React Hooks:
{
"rules": {
"destructure-check/max-depth": ["warn", 1, true]
}
}This will allow up to 1 level deep of destructuring:
const {
a: { b }
} = object;Destructuring assignment must have a default value:
{
"rules": {
"destructure-check/must-default": ["warn"]
}
}Supported Rules
- Fill in provided rules here