@dartess/eslint-plugin 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +134 -0
- package/dist/configs/mobx.d.ts +3 -0
- package/dist/configs/mobx.js +13 -0
- package/dist/configs/next.d.ts +3 -0
- package/dist/configs/next.js +17 -0
- package/dist/configs/react.d.ts +3 -0
- package/dist/configs/react.js +78 -0
- package/dist/configs/recommended.d.ts +3 -0
- package/dist/configs/recommended.js +211 -0
- package/dist/configs/storybook.d.ts +3 -0
- package/dist/configs/storybook.js +20 -0
- package/dist/configs/vendor-rules/best-practices.d.ts +120 -0
- package/dist/configs/vendor-rules/best-practices.js +248 -0
- package/dist/configs/vendor-rules/errors.d.ts +40 -0
- package/dist/configs/vendor-rules/errors.js +92 -0
- package/dist/configs/vendor-rules/es6.d.ts +47 -0
- package/dist/configs/vendor-rules/es6.js +108 -0
- package/dist/configs/vendor-rules/imports.d.ts +41 -0
- package/dist/configs/vendor-rules/imports.js +119 -0
- package/dist/configs/vendor-rules/next-config.d.ts +16 -0
- package/dist/configs/vendor-rules/next-config.js +22 -0
- package/dist/configs/vendor-rules/react-hooks.d.ts +10 -0
- package/dist/configs/vendor-rules/react-hooks.js +17 -0
- package/dist/configs/vendor-rules/react.d.ts +228 -0
- package/dist/configs/vendor-rules/react.js +513 -0
- package/dist/configs/vendor-rules/strict.d.ts +4 -0
- package/dist/configs/vendor-rules/strict.js +9 -0
- package/dist/configs/vendor-rules/style.d.ts +34 -0
- package/dist/configs/vendor-rules/style.js +78 -0
- package/dist/configs/vendor-rules/typescript-disablings.d.ts +5 -0
- package/dist/configs/vendor-rules/typescript-disablings.js +13 -0
- package/dist/configs/vendor-rules/typescript.d.ts +40 -0
- package/dist/configs/vendor-rules/typescript.js +69 -0
- package/dist/configs/vendor-rules/variables.d.ts +28 -0
- package/dist/configs/vendor-rules/variables.js +39 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25 -0
- package/dist/rules/jsx-text-as-child.d.ts +13 -0
- package/dist/rules/jsx-text-as-child.js +90 -0
- package/dist/rules/max-parent-import-depth.d.ts +3 -0
- package/dist/rules/max-parent-import-depth.js +50 -0
- package/dist/rules/prevent-mixing-external-and-internal-classes.d.ts +13 -0
- package/dist/rules/prevent-mixing-external-and-internal-classes.js +72 -0
- package/dist/rules/require-observer.d.ts +3 -0
- package/dist/rules/require-observer.js +138 -0
- package/dist/rules/stories-export-meta.d.ts +3 -0
- package/dist/rules/stories-export-meta.js +37 -0
- package/dist/rules/stories-export-typed.d.ts +3 -0
- package/dist/rules/stories-export-typed.js +51 -0
- package/dist/rules/strict-observable-components-declaration.d.ts +14 -0
- package/dist/rules/strict-observable-components-declaration.js +118 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/parse-git-ignore.d.ts +2 -0
- package/dist/utils/parse-git-ignore.js +7 -0
- package/docs/rules/jsx-text-as-child.md +101 -0
- package/docs/rules/max-parent-import-depth.md +31 -0
- package/docs/rules/prevent-mixing-external-and-internal-classes.md +42 -0
- package/docs/rules/require-observer.md +43 -0
- package/docs/rules/stories-export-meta.md +37 -0
- package/docs/rules/stories-export-typed.md +42 -0
- package/docs/rules/strict-observable-components-declaration.md +57 -0
- package/package.json +91 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// This file contains code from the `eslint-config-airbnb` project
|
|
2
|
+
// Original author: Jake Teton-Landis (https://twitter.com/@jitl)
|
|
3
|
+
// License: MIT (see LICENSE-eslint-config-airbnb.md file)
|
|
4
|
+
// Permalink: https://github.com/airbnb/javascript/blob/c25bce83be4db06e6a221d79686c485cd2ed5d5d/packages/eslint-config-airbnb-base/rules/imports.js
|
|
5
|
+
const rules = {
|
|
6
|
+
// Static analysis:
|
|
7
|
+
// ensure imports point to files/modules that can be resolved
|
|
8
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
9
|
+
'import-x/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
|
|
10
|
+
// ensure default import coupled with default export
|
|
11
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
|
|
12
|
+
'import-x/default': 'off',
|
|
13
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/namespace.md
|
|
14
|
+
'import-x/namespace': 'off',
|
|
15
|
+
// Helpful warnings:
|
|
16
|
+
// do not allow a default import name to match a named export
|
|
17
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
|
|
18
|
+
'import-x/no-named-as-default': 'error',
|
|
19
|
+
// Forbid the use of extraneous packages
|
|
20
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
21
|
+
// paths are treated both as absolute paths, and relative to process.cwd()
|
|
22
|
+
'import-x/no-extraneous-dependencies': [
|
|
23
|
+
'error',
|
|
24
|
+
{
|
|
25
|
+
devDependencies: [
|
|
26
|
+
'test/**', // tape, common npm pattern
|
|
27
|
+
'tests/**', // also common npm pattern
|
|
28
|
+
'spec/**', // mocha, rspec-like pattern
|
|
29
|
+
'**/__tests__/**', // jest pattern
|
|
30
|
+
'**/__mocks__/**', // jest pattern
|
|
31
|
+
'test.{js,jsx}', // repos with a single test file
|
|
32
|
+
'test-*.{js,jsx}', // repos with multiple top-level test files
|
|
33
|
+
'**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
|
|
34
|
+
'**/jest.config.js', // jest config
|
|
35
|
+
'**/jest.setup.js', // jest setup
|
|
36
|
+
'**/vue.config.js', // vue-cli config
|
|
37
|
+
'**/webpack.config.js', // webpack config
|
|
38
|
+
'**/webpack.config.*.js', // webpack config
|
|
39
|
+
'**/rollup.config.js', // rollup config
|
|
40
|
+
'**/rollup.config.*.js', // rollup config
|
|
41
|
+
'**/gulpfile.js', // gulp config
|
|
42
|
+
'**/gulpfile.*.js', // gulp config
|
|
43
|
+
'**/Gruntfile{,.js}', // grunt config
|
|
44
|
+
'**/protractor.conf.js', // protractor config
|
|
45
|
+
'**/protractor.conf.*.js', // protractor config
|
|
46
|
+
'**/karma.conf.js', // karma config
|
|
47
|
+
'**/.eslintrc.js', // eslint config
|
|
48
|
+
],
|
|
49
|
+
optionalDependencies: false,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
// Forbid mutable exports
|
|
53
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
|
|
54
|
+
'import-x/no-mutable-exports': 'error',
|
|
55
|
+
// Module systems:
|
|
56
|
+
// disallow AMD require/define
|
|
57
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
58
|
+
'import-x/no-amd': 'error',
|
|
59
|
+
// No Node.js builtin modules
|
|
60
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
|
|
61
|
+
'import-x/no-nodejs-modules': 'error',
|
|
62
|
+
// Style guide:
|
|
63
|
+
// disallow non-import statements appearing before import statements
|
|
64
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
65
|
+
'import-x/first': 'error',
|
|
66
|
+
// disallow duplicate imports
|
|
67
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
68
|
+
'import-x/no-duplicates': 'error',
|
|
69
|
+
// Ensure consistent use of file extension within the import path
|
|
70
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/extensions.md
|
|
71
|
+
'import-x/extensions': [
|
|
72
|
+
'error',
|
|
73
|
+
'ignorePackages',
|
|
74
|
+
{
|
|
75
|
+
js: 'never',
|
|
76
|
+
mjs: 'never',
|
|
77
|
+
jsx: 'never',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
// Require a newline after the last import/require in a group
|
|
81
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
82
|
+
'import-x/newline-after-import': 'error',
|
|
83
|
+
// Forbid import of modules using absolute paths
|
|
84
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
|
|
85
|
+
'import-x/no-absolute-path': 'error',
|
|
86
|
+
// Forbid require() calls with expressions
|
|
87
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
|
|
88
|
+
'import-x/no-dynamic-require': 'error',
|
|
89
|
+
// Forbid Webpack loader syntax in imports
|
|
90
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
91
|
+
'import-x/no-webpack-loader-syntax': 'error',
|
|
92
|
+
// Prevent importing the default as if it were named
|
|
93
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
|
94
|
+
'import-x/no-named-default': 'error',
|
|
95
|
+
// Forbid a module from importing itself
|
|
96
|
+
// https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
|
|
97
|
+
'import-x/no-self-import': 'error',
|
|
98
|
+
// Forbid cyclical dependencies between modules
|
|
99
|
+
// https://github.com/import-js/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
|
|
100
|
+
'import-x/no-cycle': ['error', { maxDepth: '∞' }],
|
|
101
|
+
// Ensures that there are no useless path segments
|
|
102
|
+
// https://github.com/import-js/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
|
|
103
|
+
'import-x/no-useless-path-segments': ['error', { commonjs: true }],
|
|
104
|
+
// Reports the use of import declarations with CommonJS exports in any module except for the main module.
|
|
105
|
+
// https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-import-module-exports.md
|
|
106
|
+
'import-x/no-import-module-exports': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
exceptions: [],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
// Use this rule to prevent importing packages through relative paths.
|
|
113
|
+
// https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-relative-packages.md
|
|
114
|
+
'import-x/no-relative-packages': 'error',
|
|
115
|
+
// Reports the use of empty named import blocks.
|
|
116
|
+
// https://github.com/import-js/eslint-plugin-import/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/no-empty-named-blocks.md
|
|
117
|
+
'import-x/no-empty-named-blocks': 'error',
|
|
118
|
+
};
|
|
119
|
+
export default rules;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const rules: {
|
|
2
|
+
'import-x/no-anonymous-default-export': "error";
|
|
3
|
+
'react/no-unknown-property': "off";
|
|
4
|
+
'react/react-in-jsx-scope': "off";
|
|
5
|
+
'jsx-a11y/alt-text': ["error", {
|
|
6
|
+
elements: string[];
|
|
7
|
+
img: string[];
|
|
8
|
+
}];
|
|
9
|
+
'jsx-a11y/aria-props': "error";
|
|
10
|
+
'jsx-a11y/aria-proptypes': "error";
|
|
11
|
+
'jsx-a11y/aria-unsupported-elements': "error";
|
|
12
|
+
'jsx-a11y/role-has-required-aria-props': "error";
|
|
13
|
+
'jsx-a11y/role-supports-aria-props': "error";
|
|
14
|
+
'react/jsx-no-target-blank': "off";
|
|
15
|
+
};
|
|
16
|
+
export default rules;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// This file contains code from the `eslint-config-next` project
|
|
2
|
+
// License: MIT (see LICENSE-next.js.md file)
|
|
3
|
+
// Permalink: https://github.com/vercel/next.js/blob/23c4cf0c2ff93b37703e62faf7a1d4700834a0f7/packages/eslint-config-next/index.js
|
|
4
|
+
const rules = {
|
|
5
|
+
'import-x/no-anonymous-default-export': 'error',
|
|
6
|
+
'react/no-unknown-property': 'off',
|
|
7
|
+
'react/react-in-jsx-scope': 'off',
|
|
8
|
+
'jsx-a11y/alt-text': [
|
|
9
|
+
'error',
|
|
10
|
+
{
|
|
11
|
+
elements: ['img'],
|
|
12
|
+
img: ['Image'],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
'jsx-a11y/aria-props': 'error',
|
|
16
|
+
'jsx-a11y/aria-proptypes': 'error',
|
|
17
|
+
'jsx-a11y/aria-unsupported-elements': 'error',
|
|
18
|
+
'jsx-a11y/role-has-required-aria-props': 'error',
|
|
19
|
+
'jsx-a11y/role-supports-aria-props': 'error',
|
|
20
|
+
'react/jsx-no-target-blank': 'off',
|
|
21
|
+
};
|
|
22
|
+
export default rules;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const rules: {
|
|
2
|
+
/**
|
|
3
|
+
* react-hooks
|
|
4
|
+
* copied from
|
|
5
|
+
* https://github.com/airbnb/javascript/blob/c25bce83be4db06e6a221d79686c485cd2ed5d5d/packages/eslint-config-airbnb/rules/react-hooks.js
|
|
6
|
+
* */
|
|
7
|
+
'react-hooks/rules-of-hooks': "error";
|
|
8
|
+
'react-hooks/exhaustive-deps': "error";
|
|
9
|
+
};
|
|
10
|
+
export default rules;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file contains code from the `eslint-config-airbnb` project
|
|
2
|
+
// Original author: Jake Teton-Landis (https://twitter.com/@jitl)
|
|
3
|
+
// License: MIT (see LICENSE-eslint-config-airbnb.md file)
|
|
4
|
+
const rules = {
|
|
5
|
+
/**
|
|
6
|
+
* react-hooks
|
|
7
|
+
* copied from
|
|
8
|
+
* https://github.com/airbnb/javascript/blob/c25bce83be4db06e6a221d79686c485cd2ed5d5d/packages/eslint-config-airbnb/rules/react-hooks.js
|
|
9
|
+
* */
|
|
10
|
+
// Enforce Rules of Hooks
|
|
11
|
+
// https://github.com/facebook/react/blob/c11015ff4f610ac2924d1fc6d569a17657a404fd/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
|
|
12
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
13
|
+
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
14
|
+
// https://github.com/facebook/react/blob/1204c789776cb01fbaf3e9f032e7e2ba85a44137/packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
|
|
15
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
16
|
+
};
|
|
17
|
+
export default rules;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
declare const rules: {
|
|
2
|
+
/**
|
|
3
|
+
* react
|
|
4
|
+
* copied from
|
|
5
|
+
* https://github.com/airbnb/javascript/blob/c25bce83be4db06e6a221d79686c485cd2ed5d5d/packages/eslint-config-airbnb/rules/react-a11y.js
|
|
6
|
+
* */
|
|
7
|
+
'no-underscore-dangle': ["error", {
|
|
8
|
+
allowAfterThis: boolean;
|
|
9
|
+
allowAfterSuper: boolean;
|
|
10
|
+
enforceInMethodNames: boolean;
|
|
11
|
+
allow: string[];
|
|
12
|
+
}];
|
|
13
|
+
'react/display-name': ["off", {
|
|
14
|
+
ignoreTranspilerName: boolean;
|
|
15
|
+
}];
|
|
16
|
+
'react/jsx-boolean-value': ["error", string, {
|
|
17
|
+
always: never[];
|
|
18
|
+
}];
|
|
19
|
+
'react/jsx-closing-bracket-location': ["error", string];
|
|
20
|
+
'react/jsx-closing-tag-location': "error";
|
|
21
|
+
'react/jsx-curly-spacing': ["error", string, {
|
|
22
|
+
allowMultiline: boolean;
|
|
23
|
+
}];
|
|
24
|
+
'react/jsx-indent-props': ["error", number];
|
|
25
|
+
'react/jsx-max-props-per-line': ["error", {
|
|
26
|
+
maximum: number;
|
|
27
|
+
when: string;
|
|
28
|
+
}];
|
|
29
|
+
'react/jsx-no-bind': ["error", {
|
|
30
|
+
ignoreRefs: boolean;
|
|
31
|
+
allowArrowFunctions: boolean;
|
|
32
|
+
allowFunctions: boolean;
|
|
33
|
+
allowBind: boolean;
|
|
34
|
+
ignoreDOMComponents: boolean;
|
|
35
|
+
}];
|
|
36
|
+
'react/jsx-pascal-case': ["error", {
|
|
37
|
+
allowAllCaps: boolean;
|
|
38
|
+
ignore: never[];
|
|
39
|
+
}];
|
|
40
|
+
'react/jsx-uses-vars': "error";
|
|
41
|
+
'react/no-danger': "error";
|
|
42
|
+
'react/no-deprecated': ["error"];
|
|
43
|
+
'react/no-did-update-set-state': "error";
|
|
44
|
+
'react/no-will-update-set-state': "error";
|
|
45
|
+
'react/no-direct-mutation-state': "off";
|
|
46
|
+
'react/no-is-mounted': "error";
|
|
47
|
+
'react/no-string-refs': "error";
|
|
48
|
+
'react/no-unknown-property': "error";
|
|
49
|
+
'react/prefer-es6-class': ["error", string];
|
|
50
|
+
'react/prefer-stateless-function': ["error", {
|
|
51
|
+
ignorePureComponents: boolean;
|
|
52
|
+
}];
|
|
53
|
+
'react/require-render-return': "error";
|
|
54
|
+
'react/self-closing-comp': "error";
|
|
55
|
+
'react/sort-comp': ["error", {
|
|
56
|
+
order: string[];
|
|
57
|
+
groups: {
|
|
58
|
+
lifecycle: string[];
|
|
59
|
+
rendering: string[];
|
|
60
|
+
};
|
|
61
|
+
}];
|
|
62
|
+
'react/jsx-wrap-multilines': ["error", {
|
|
63
|
+
declaration: string;
|
|
64
|
+
assignment: string;
|
|
65
|
+
return: string;
|
|
66
|
+
arrow: string;
|
|
67
|
+
condition: string;
|
|
68
|
+
logical: string;
|
|
69
|
+
prop: string;
|
|
70
|
+
}];
|
|
71
|
+
'react/jsx-first-prop-new-line': ["error", string];
|
|
72
|
+
'react/jsx-equals-spacing': ["error", string];
|
|
73
|
+
'react/jsx-indent': ["error", number];
|
|
74
|
+
'react/jsx-no-target-blank': ["error", {
|
|
75
|
+
enforceDynamicLinks: string;
|
|
76
|
+
}];
|
|
77
|
+
'react/jsx-filename-extension': ["error", {
|
|
78
|
+
extensions: string[];
|
|
79
|
+
}];
|
|
80
|
+
'react/jsx-no-comment-textnodes': "error";
|
|
81
|
+
'react/no-render-return-value': "error";
|
|
82
|
+
'react/no-find-dom-node': "error";
|
|
83
|
+
'react/no-danger-with-children': "error";
|
|
84
|
+
'react/style-prop-object': "error";
|
|
85
|
+
'react/no-unescaped-entities': "error";
|
|
86
|
+
'react/no-children-prop': "error";
|
|
87
|
+
'react/jsx-tag-spacing': ["error", {
|
|
88
|
+
closingSlash: string;
|
|
89
|
+
beforeSelfClosing: string;
|
|
90
|
+
afterOpening: string;
|
|
91
|
+
beforeClosing: string;
|
|
92
|
+
}];
|
|
93
|
+
'react/require-default-props': ["error", {
|
|
94
|
+
forbidDefaultForRequired: boolean;
|
|
95
|
+
}];
|
|
96
|
+
'react/void-dom-elements-no-children': "error";
|
|
97
|
+
'react/no-redundant-should-component-update': "error";
|
|
98
|
+
'react/no-unused-state': "error";
|
|
99
|
+
'react/no-typos': "error";
|
|
100
|
+
'react/jsx-curly-brace-presence': ["error", {
|
|
101
|
+
props: string;
|
|
102
|
+
children: string;
|
|
103
|
+
}];
|
|
104
|
+
'react/jsx-one-expression-per-line': ["error", {
|
|
105
|
+
allow: string;
|
|
106
|
+
}];
|
|
107
|
+
'react/no-access-state-in-setstate': "error";
|
|
108
|
+
'react/button-has-type': ["error", {
|
|
109
|
+
button: boolean;
|
|
110
|
+
submit: boolean;
|
|
111
|
+
reset: boolean;
|
|
112
|
+
}];
|
|
113
|
+
'react/no-this-in-sfc': "error";
|
|
114
|
+
'react/jsx-props-no-multi-spaces': "error";
|
|
115
|
+
'react/jsx-fragments': ["error", string];
|
|
116
|
+
'react/jsx-curly-newline': ["error", {
|
|
117
|
+
multiline: string;
|
|
118
|
+
singleline: string;
|
|
119
|
+
}];
|
|
120
|
+
'react/jsx-props-no-spreading': ["error", {
|
|
121
|
+
html: string;
|
|
122
|
+
custom: string;
|
|
123
|
+
explicitSpread: string;
|
|
124
|
+
exceptions: never[];
|
|
125
|
+
}];
|
|
126
|
+
'react/jsx-no-script-url': ["error", {
|
|
127
|
+
name: string;
|
|
128
|
+
props: string[];
|
|
129
|
+
}[]];
|
|
130
|
+
'react/jsx-no-useless-fragment': "error";
|
|
131
|
+
'react/jsx-no-constructed-context-values': "error";
|
|
132
|
+
'react/no-unstable-nested-components': "error";
|
|
133
|
+
'react/no-namespace': "error";
|
|
134
|
+
'react/prefer-exact-props': "error";
|
|
135
|
+
'react/no-arrow-function-lifecycle': "error";
|
|
136
|
+
'react/no-invalid-html-attribute': "error";
|
|
137
|
+
'react/no-unused-class-component-methods': "error";
|
|
138
|
+
'react/hook-use-state': "error";
|
|
139
|
+
'react/iframe-missing-sandbox': "error";
|
|
140
|
+
/**
|
|
141
|
+
* react-a11y
|
|
142
|
+
* copied from
|
|
143
|
+
* https://github.com/airbnb/javascript/blob/c25bce83be4db06e6a221d79686c485cd2ed5d5d/packages/eslint-config-airbnb/rules/react-a11y.js
|
|
144
|
+
* */
|
|
145
|
+
'jsx-a11y/alt-text': ["error", {
|
|
146
|
+
elements: string[];
|
|
147
|
+
img: never[];
|
|
148
|
+
object: never[];
|
|
149
|
+
area: never[];
|
|
150
|
+
'input[type="image"]': never[];
|
|
151
|
+
}];
|
|
152
|
+
'jsx-a11y/anchor-has-content': ["error", {
|
|
153
|
+
components: never[];
|
|
154
|
+
}];
|
|
155
|
+
'jsx-a11y/anchor-is-valid': ["error", {
|
|
156
|
+
components: string[];
|
|
157
|
+
specialLink: string[];
|
|
158
|
+
aspects: string[];
|
|
159
|
+
}];
|
|
160
|
+
'jsx-a11y/aria-activedescendant-has-tabindex': "error";
|
|
161
|
+
'jsx-a11y/aria-props': "error";
|
|
162
|
+
'jsx-a11y/aria-proptypes': "error";
|
|
163
|
+
'jsx-a11y/aria-role': ["error", {
|
|
164
|
+
ignoreNonDOM: boolean;
|
|
165
|
+
}];
|
|
166
|
+
'jsx-a11y/aria-unsupported-elements': "error";
|
|
167
|
+
'jsx-a11y/autocomplete-valid': ["off", {
|
|
168
|
+
inputComponents: never[];
|
|
169
|
+
}];
|
|
170
|
+
'jsx-a11y/click-events-have-key-events': "error";
|
|
171
|
+
'jsx-a11y/heading-has-content': ["error", {
|
|
172
|
+
components: string[];
|
|
173
|
+
}];
|
|
174
|
+
'jsx-a11y/html-has-lang': "error";
|
|
175
|
+
'jsx-a11y/iframe-has-title': "error";
|
|
176
|
+
'jsx-a11y/img-redundant-alt': "error";
|
|
177
|
+
'jsx-a11y/interactive-supports-focus': "error";
|
|
178
|
+
'jsx-a11y/label-has-associated-control': ["error", {
|
|
179
|
+
labelComponents: never[];
|
|
180
|
+
labelAttributes: never[];
|
|
181
|
+
controlComponents: never[];
|
|
182
|
+
assert: string;
|
|
183
|
+
depth: number;
|
|
184
|
+
}];
|
|
185
|
+
'jsx-a11y/lang': "error";
|
|
186
|
+
'jsx-a11y/media-has-caption': ["error", {
|
|
187
|
+
audio: never[];
|
|
188
|
+
video: never[];
|
|
189
|
+
track: never[];
|
|
190
|
+
}];
|
|
191
|
+
'jsx-a11y/mouse-events-have-key-events': "error";
|
|
192
|
+
'jsx-a11y/no-access-key': "error";
|
|
193
|
+
'jsx-a11y/no-distracting-elements': ["error", {
|
|
194
|
+
elements: string[];
|
|
195
|
+
}];
|
|
196
|
+
'jsx-a11y/no-interactive-element-to-noninteractive-role': ["error", {
|
|
197
|
+
tr: string[];
|
|
198
|
+
}];
|
|
199
|
+
'jsx-a11y/no-noninteractive-element-interactions': ["error", {
|
|
200
|
+
handlers: string[];
|
|
201
|
+
}];
|
|
202
|
+
'jsx-a11y/no-noninteractive-element-to-interactive-role': ["error", {
|
|
203
|
+
ul: string[];
|
|
204
|
+
ol: string[];
|
|
205
|
+
li: string[];
|
|
206
|
+
table: string[];
|
|
207
|
+
td: string[];
|
|
208
|
+
}];
|
|
209
|
+
'jsx-a11y/no-noninteractive-tabindex': ["error", {
|
|
210
|
+
tags: never[];
|
|
211
|
+
roles: string[];
|
|
212
|
+
allowExpressionValues: boolean;
|
|
213
|
+
}];
|
|
214
|
+
'jsx-a11y/no-redundant-roles': ["error", {
|
|
215
|
+
nav: string[];
|
|
216
|
+
}];
|
|
217
|
+
'jsx-a11y/no-static-element-interactions': ["error", {
|
|
218
|
+
handlers: string[];
|
|
219
|
+
}];
|
|
220
|
+
'jsx-a11y/role-has-required-aria-props': "error";
|
|
221
|
+
'jsx-a11y/role-supports-aria-props': "error";
|
|
222
|
+
'jsx-a11y/scope': "error";
|
|
223
|
+
'jsx-a11y/tabindex-no-positive': "error";
|
|
224
|
+
'jsx-a11y/anchor-ambiguous-text': "error";
|
|
225
|
+
'jsx-a11y/no-aria-hidden-on-focusable': "error";
|
|
226
|
+
'jsx-a11y/prefer-tag-over-role': "error";
|
|
227
|
+
};
|
|
228
|
+
export default rules;
|