eslint-plugin-deku
v3.1.2
Published
Deku specific linting rules for ESLint
Downloads
21
Maintainers
Readme
ESLint-plugin-Deku
Deku specific linting rules for ESLint. Forked from yannickcr/eslint-plugin-react with slight modifications to support deku.
Installation
Install ESLint either locally or globally.
npm install eslint
If you installed ESLint
globally, you have to install Deku plugin globally too. Otherwise, install it locally.
$ npm install eslint-plugin-deku
Configuration
Add plugins
section and specify ESLint-plugin-Deku as a plugin.
{
"plugins": [
"deku"
]
}
If it is not already the case you must also configure ESLint
to support JSX.
{
"ecmaFeatures": {
"jsx": true
}
}
Finally, enable all of the rules that you would like to use.
{
"rules": {
"deku/display-name": 1,
"deku/jsx-boolean-value": 1,
"deku/jsx-curly-spacing": 1,
"deku/jsx-max-props-per-line": 1,
"deku/jsx-no-duplicate-props": 1,
"deku/jsx-no-undef": 1,
"deku/jsx-quotes": 1,
"deku/jsx-sort-prop-types": 1,
"deku/jsx-sort-props": 1,
"deku/jsx-uses-deku": 1,
"deku/jsx-uses-vars": 1,
"deku/no-danger": 1,
"deku/no-did-mount-set-state": 1,
"deku/no-did-update-set-state": 1,
"deku/no-multi-comp": 1,
"deku/no-unknown-property": 1,
"deku/prop-types": 1,
"deku/deku-in-jsx-scope": 1,
"deku/require-extension": 1,
"deku/self-closing-comp": 1,
"deku/sort-comp": 1,
"deku/wrap-multilines": 1
}
}
List of supported rules
- display-name: Prevent missing displayName in a Deku component definition
- jsx-boolean-value: Enforce boolean attributes notation in JSX
- jsx-curly-spacing: Enforce or disallow spaces inside of curly braces in JSX attributes
- jsx-max-props-per-line: Limit maximum of props on a single line in JSX
- jsx-no-duplicate-props: Prevent duplicate props in JSX
- jsx-no-undef: Disallow undeclared variables in JSX
- jsx-quotes: Enforce quote style for JSX attributes
- jsx-sort-prop-types: Enforce propTypes declarations alphabetical sorting
- jsx-sort-props: Enforce props alphabetical sorting
- jsx-uses-deku: Prevent Deku to be incorrectly marked as unused
- jsx-uses-vars: Prevent variables used in JSX to be incorrectly marked as unused
- no-danger: Prevent usage of dangerous JSX properties
- no-did-mount-set-state: Prevent usage of setState in componentDidMount
- no-did-update-set-state: Prevent usage of setState in componentDidUpdate
- no-multi-comp: Prevent multiple component definition per file
- no-unknown-property: Prevent usage of unknown DOM property
- prop-types: Prevent missing props validation in a Deku component definition
- deku-in-jsx-scope: Prevent missing Deku when using JSX
- require-extension: Restrict file extensions that may be required
- self-closing-comp: Prevent extra closing tags for components without children
- sort-comp: Enforce component methods order
- wrap-multilines: Prevent missing parentheses around multilines JSX
License
ESLint-plugin-Deku is licensed under the MIT License.