70 lines
2.4 KiB
JavaScript
70 lines
2.4 KiB
JavaScript
|
const semver = require('semver')
|
||
|
const PKG = require('../../package.json')
|
||
|
|
||
|
module.exports = {
|
||
|
plugins: [
|
||
|
'react',
|
||
|
'react-hooks',
|
||
|
'jsx-a11y',
|
||
|
],
|
||
|
|
||
|
parserOptions: {
|
||
|
ecmaFeatures: {
|
||
|
jsx: true
|
||
|
}
|
||
|
},
|
||
|
|
||
|
settings: {
|
||
|
react: {
|
||
|
version: semver.valid(semver.coerce(PKG.dependencies.react)),
|
||
|
},
|
||
|
},
|
||
|
|
||
|
rules: {
|
||
|
'react/jsx-uses-react': 'error',
|
||
|
'react/react-in-jsx-scope': 'error',
|
||
|
'react/jsx-uses-vars': 'error',
|
||
|
'react/jsx-no-undef': 'error',
|
||
|
'react/jsx-pascal-case': 'error',
|
||
|
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
|
||
|
'react/no-danger': 'error',
|
||
|
'react/self-closing-comp': 'error',
|
||
|
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
|
||
|
'react-hooks/exhaustive-deps': 'error', // Checks effect dependencies
|
||
|
'jsx-a11y/accessible-emoji': 'error',
|
||
|
'jsx-a11y/alt-text': 'error',
|
||
|
'jsx-a11y/anchor-has-content': 'error',
|
||
|
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
||
|
'jsx-a11y/aria-props': 'error',
|
||
|
'jsx-a11y/aria-proptypes': 'error',
|
||
|
'jsx-a11y/aria-role': 'error',
|
||
|
'jsx-a11y/aria-unsupported-elements': 'error',
|
||
|
'jsx-a11y/click-events-have-key-events': 'error',
|
||
|
'jsx-a11y/heading-has-content': 'error',
|
||
|
'jsx-a11y/html-has-lang': 'error',
|
||
|
'jsx-a11y/iframe-has-title': 'error',
|
||
|
'jsx-a11y/interactive-supports-focus': 'error',
|
||
|
'jsx-a11y/label-has-associated-control': 'error',
|
||
|
'jsx-a11y/media-has-caption': 'error',
|
||
|
'jsx-a11y/mouse-events-have-key-events': 'error',
|
||
|
'jsx-a11y/no-access-key': 'error',
|
||
|
'jsx-a11y/no-distracting-elements': 'error',
|
||
|
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error',
|
||
|
'jsx-a11y/no-noninteractive-element-interactions': 'error',
|
||
|
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error',
|
||
|
'jsx-a11y/no-onchange': 'error',
|
||
|
'jsx-a11y/no-redundant-roles': 'error',
|
||
|
'jsx-a11y/role-has-required-aria-props': 'error',
|
||
|
'jsx-a11y/role-supports-aria-props': 'error',
|
||
|
'jsx-a11y/scope': 'error',
|
||
|
'jsx-a11y/tabindex-no-positive': 'error',
|
||
|
'react/no-will-update-set-state': 'error',
|
||
|
'react/no-is-mounted': 'error',
|
||
|
'react/no-multi-comp': ['error', { ignoreStateless: true }],
|
||
|
'react/no-unknown-property': 'error',
|
||
|
'react/prefer-es6-class': ['error', 'always'],
|
||
|
'react/prefer-stateless-function': ['error', { ignorePureComponents: true }],
|
||
|
'react/no-unescaped-entities': 'error',
|
||
|
},
|
||
|
}
|