* chore(NA): ensure scripts run with --preserve-symlinks * chore(NA): run webpack configs with symlinks: false * chore(NA): fix pkg json load on kbn test * chore(NA): add script into setup node env * chore(NA): fix kbn test for relative improt * chore(NA): fix change on docs * chore(NA): move ensure node preserve symlinks into setup node env * chore(NA): update changed docs * chore(NA): update jest unit test * chore(NA): fix wrapper script exit code * chore(NA): updated generated plugin list docs * fix(NA): make functional test runner use kbn utils repo_root * chore(NA): fix eslint imports * chore(NA): missing react correct config on eslint package * chore(NA): use correct value to make test pass locally * chore(NA): fix jest tests * chore(NA): try remove extra preserve symlinks * chore(NA): fix windows environment * chore(NA): fix kbn-optimizer to run with preserve-symlinks * chore(NA): fix integration jest test for kbn/optimizer * chore(NA): remove require.resolve from eslintrc.js * chore(NA): avoid load json file * chore(NA): move kbn/utils import into kbn/dev-utils * chore(NA): use correct dependencies on eslint config package Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
70 lines
2.4 KiB
JavaScript
70 lines
2.4 KiB
JavaScript
const semver = require('semver');
|
|
const { kibanaPackageJson: PKG } = require('@kbn/dev-utils');
|
|
|
|
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',
|
|
},
|
|
}
|