@perfective/eslint-config-react 0.16.0 → 0.18.0

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.
Files changed (44) hide show
  1. package/LICENSE +1 -1
  2. package/README.adoc +66 -42
  3. package/README.md +60 -48
  4. package/config/jsx-a11y/jsx-a11y-config.d.ts +2 -0
  5. package/config/jsx-a11y/jsx-a11y-config.js +81 -0
  6. package/config/perfective-eslint-react-config.d.ts +7 -0
  7. package/config/perfective-eslint-react-config.js +24 -0
  8. package/config/react/jsx.d.ts +1 -0
  9. package/config/react/jsx.js +88 -0
  10. package/config/react/react-config.d.ts +2 -0
  11. package/config/react/react-config.js +139 -0
  12. package/config/react-hooks/react-hooks-config.d.ts +2 -0
  13. package/config/react-hooks/react-hooks-config.js +29 -0
  14. package/config/react-perf/react-perf-config.d.ts +2 -0
  15. package/config/react-perf/react-perf-config.js +14 -0
  16. package/config/testing-library/index.d.ts +1 -0
  17. package/config/testing-library/index.js +1 -0
  18. package/config/testing-library/testing-library-config.d.ts +8 -0
  19. package/config/testing-library/testing-library-config.js +14 -0
  20. package/config/typescript-eslint/index.d.ts +1 -0
  21. package/config/typescript-eslint/index.js +1 -0
  22. package/{rules/eslint-config → config/typescript-eslint}/rules/typescript-eslint.d.ts +5 -1
  23. package/config/typescript-eslint/rules/typescript-eslint.js +11 -0
  24. package/config/unicorn/index.d.ts +1 -0
  25. package/config/unicorn/index.js +1 -0
  26. package/{rules/eslint-config → config/unicorn}/rules/unicorn.d.ts +4 -1
  27. package/config/unicorn/rules/unicorn.js +9 -0
  28. package/index.d.ts +1 -0
  29. package/index.js +1 -58
  30. package/package.json +29 -8
  31. package/testing-library/package.json +13 -0
  32. package/typescript-eslint/package.json +13 -0
  33. package/unicorn/package.json +13 -0
  34. package/rules/eslint-config/index.js +0 -15
  35. package/rules/eslint-config/rules/typescript-eslint.js +0 -17
  36. package/rules/eslint-config/rules/unicorn.js +0 -7
  37. package/rules/jsx-a11y/index.js +0 -79
  38. package/rules/react/index.js +0 -159
  39. package/rules/react/jsx.js +0 -91
  40. package/rules/react-hooks/index.js +0 -10
  41. package/rules/react-hooks-ssr/index.js +0 -9
  42. package/rules/react-perf/index.js +0 -12
  43. package/rules.d.ts +0 -3
  44. package/rules.js +0 -13
@@ -0,0 +1,14 @@
1
+ import reactPerfPlugin from 'eslint-plugin-react-perf';
2
+ export function reactPerfConfig() {
3
+ return {
4
+ plugins: {
5
+ 'react-perf': reactPerfPlugin
6
+ },
7
+ rules: {
8
+ 'react-perf/jsx-no-jsx-as-prop': 'error',
9
+ 'react-perf/jsx-no-new-array-as-prop': 'error',
10
+ 'react-perf/jsx-no-new-function-as-prop': 'error',
11
+ 'react-perf/jsx-no-new-object-as-prop': 'error'
12
+ }
13
+ };
14
+ }
@@ -0,0 +1 @@
1
+ export { testingLibraryConfig } from './testing-library-config';
@@ -0,0 +1 @@
1
+ export { testingLibraryConfig } from "./testing-library-config.js";
@@ -0,0 +1,8 @@
1
+ import { Linter } from 'eslint';
2
+ import { Glob } from '@perfective/eslint-config';
3
+ /**
4
+ * Creates a flat config for `eslint-plugin-testing-library` for a given list of files globs.
5
+ *
6
+ * @since v0.17.0
7
+ */
8
+ export declare function testingLibraryConfig(files?: Glob[]): Linter.Config;
@@ -0,0 +1,14 @@
1
+ import { jestFiles } from '@perfective/eslint-config';
2
+ import { testingLibraryConfig as perfectiveTestingLibraryConfig } from '@perfective/eslint-config/testing-library';
3
+ export function testingLibraryConfig(files = jestFiles) {
4
+ const config = perfectiveTestingLibraryConfig(files);
5
+ return {
6
+ files: config.files,
7
+ plugins: config.plugins,
8
+ rules: Object.assign(Object.assign({}, config.rules), {
9
+ 'testing-library/no-unnecessary-act': ['error', {
10
+ isStrict: true
11
+ }]
12
+ })
13
+ };
14
+ }
@@ -0,0 +1 @@
1
+ export { typescriptEslintNamingConvention } from './rules/typescript-eslint';
@@ -0,0 +1 @@
1
+ export { typescriptEslintNamingConvention } from "./rules/typescript-eslint.js";
@@ -1,2 +1,6 @@
1
- import { TypescriptEslintNamingConvention } from '@perfective/eslint-config/rules';
1
+ import { TypescriptEslintNamingConvention } from '@perfective/eslint-config/typescript-eslint';
2
+ /**
3
+ * Creates a React-compatible configuration with the given extensions
4
+ * for the `@typescript-eslint/naming-convention` rule.
5
+ */
2
6
  export declare function typescriptEslintNamingConvention(extensions?: TypescriptEslintNamingConvention[]): TypescriptEslintNamingConvention[];
@@ -0,0 +1,11 @@
1
+ import { typescriptEslintNamingConvention as typescriptEslintNamingConventionDefaults } from '@perfective/eslint-config/typescript-eslint';
2
+ export function typescriptEslintNamingConvention(extensions = []) {
3
+ return typescriptEslintNamingConventionDefaults([{
4
+ selector: ['variable'],
5
+ modifiers: ['const'],
6
+ format: ['strictCamelCase', 'StrictPascalCase']
7
+ }, {
8
+ selector: ['function'],
9
+ format: ['strictCamelCase', 'StrictPascalCase']
10
+ }].concat(extensions));
11
+ }
@@ -0,0 +1 @@
1
+ export { unicornPreventAbbreviations } from './rules/unicorn';
@@ -0,0 +1 @@
1
+ export { unicornPreventAbbreviations } from "./rules/unicorn.js";
@@ -1,2 +1,5 @@
1
- import { UnicornPreventAbbreviationReplacements, UnicornPreventAbbreviations } from '@perfective/eslint-config/rules';
1
+ import { UnicornPreventAbbreviationReplacements, UnicornPreventAbbreviations } from '@perfective/eslint-config/unicorn';
2
+ /**
3
+ * Adds React-specific abbreviations for the `unicorn/prevent-abbreviations` rule.
4
+ */
2
5
  export declare function unicornPreventAbbreviations(replacements?: UnicornPreventAbbreviationReplacements, options?: Partial<Pick<UnicornPreventAbbreviations, 'checkProperties'>>): UnicornPreventAbbreviations;
@@ -0,0 +1,9 @@
1
+ import { unicornPreventAbbreviations as unicornPreventAbbreviationsDefaults } from '@perfective/eslint-config/unicorn';
2
+ export function unicornPreventAbbreviations(replacements = {}, options = {}) {
3
+ return unicornPreventAbbreviationsDefaults(Object.assign({
4
+ prop: false,
5
+ props: false,
6
+ ref: false,
7
+ refs: false
8
+ }, replacements), options);
9
+ }
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { perfectiveEslintReactConfig } from './config/perfective-eslint-react-config';
package/index.js CHANGED
@@ -1,58 +1 @@
1
- "use strict";
2
- const config_1 = require("@perfective/eslint-config/config");
3
- module.exports = {
4
- extends: [
5
- '@perfective/eslint-config',
6
- ],
7
- overrides: [
8
- {
9
- files: ['*.ts', '*.tsx'],
10
- env: {
11
- browser: true,
12
- commonjs: true,
13
- es6: true,
14
- jest: true,
15
- node: true,
16
- },
17
- parserOptions: {
18
- ecmaVersion: 2018,
19
- sourceType: 'module',
20
- ecmaFeatures: {
21
- jsx: true,
22
- },
23
- },
24
- extends: [
25
- './rules/eslint-config',
26
- './rules/jsx-a11y',
27
- './rules/react',
28
- './rules/react-hooks',
29
- './rules/react-hooks-ssr',
30
- './rules/react-perf',
31
- ],
32
- settings: {
33
- react: {
34
- version: 'detect',
35
- createClass: 'createReactClass',
36
- pragma: 'React',
37
- fragment: 'Fragment',
38
- },
39
- propWrapperFunctions: [
40
- 'exactPropTypes',
41
- ],
42
- linkComponents: [],
43
- },
44
- },
45
- {
46
- files: ['*.tsx', '*.jsx'],
47
- rules: {
48
- 'prefer-arrow/prefer-arrow-functions': 'off',
49
- },
50
- },
51
- {
52
- files: ['*.@(spec|test).[jt]s?(x)'],
53
- rules: Object.assign({}, (0, config_1.optionalRule)('testing-library/no-unnecessary-act', ['error', {
54
- isStrict: true,
55
- }])),
56
- },
57
- ],
58
- };
1
+ export { perfectiveEslintReactConfig } from "./config/perfective-eslint-react-config.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config-react",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "ESLint shareable rules configuration for React",
5
5
  "keywords": ["react", "code quality", "code standard", "code style", "eslint", "eslint-config", "lint", "perfective", "typescript"],
6
6
  "author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
@@ -9,21 +9,42 @@
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/perfective/eslint-config-react.git"
11
11
  },
12
+ "type": "module",
12
13
  "license": "MIT",
13
14
  "dependencies": {
14
- "@perfective/eslint-config": "~0.27.1"
15
+ "@perfective/eslint-config": "~0.34.1"
15
16
  },
16
17
  "peerDependencies": {
18
+ "eslint": "^9.39.2",
17
19
  "eslint-plugin-jsx-a11y": "^6.10.2",
18
- "eslint-plugin-react": "^7.37.2",
19
- "eslint-plugin-react-hooks": "^5.0.0",
20
- "eslint-plugin-react-hooks-ssr": "^0.1.5",
21
- "eslint-plugin-react-perf": "^3.3.2"
20
+ "eslint-plugin-react": "^7.37.5",
21
+ "eslint-plugin-react-hooks": "^7.0.1",
22
+ "eslint-plugin-react-perf": "^3.3.3",
23
+ "globals": "^17.0.0"
22
24
  },
23
- "main": "./index.js",
25
+ "module": "./index.js",
26
+ "types": "./index.d.ts",
24
27
  "directories": {
25
28
  "lib": "./"
26
29
  },
27
- "files": ["**/*.js", "rules.d.ts", "rules/**/rules/*.d.ts"],
30
+ "files": ["**/package.json", "**/*.js", "**/*.d.ts"],
31
+ "exports": {
32
+ ".": {
33
+ "types": "./index.d.ts",
34
+ "import": "./index.js"
35
+ },
36
+ "./testing-library": {
37
+ "import": "./config/testing-library/index.js",
38
+ "types": "./config/testing-library/index.d.ts"
39
+ },
40
+ "./typescript-eslint": {
41
+ "import": "./config/typescript-eslint/index.js",
42
+ "types": "./config/typescript-eslint/index.d.ts"
43
+ },
44
+ "./unicorn": {
45
+ "import": "./config/unicorn/index.js",
46
+ "types": "./config/unicorn/index.d.ts"
47
+ }
48
+ },
28
49
  "scripts": {}
29
50
  }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@perfective/eslint-config-react/testing-library",
3
+ "type": "module",
4
+ "module": "../config/testing-library/index.js",
5
+ "types": "../config/testing-library/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "../config/testing-library/index.d.ts",
9
+ "import": "../config/testing-library/index.js"
10
+ }
11
+ },
12
+ "sideEffects": false
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@perfective/eslint-config-react/typescript-eslint",
3
+ "type": "module",
4
+ "module": "../config/typescript-eslint/index.js",
5
+ "types": "../config/typescript-eslint/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "../config/typescript-eslint/index.d.ts",
9
+ "import": "../config/typescript-eslint/index.js"
10
+ }
11
+ },
12
+ "sideEffects": false
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@perfective/eslint-config-react/unicorn",
3
+ "type": "module",
4
+ "module": "../config/unicorn/index.js",
5
+ "types": "../config/unicorn/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "../config/unicorn/index.d.ts",
9
+ "import": "../config/unicorn/index.js"
10
+ }
11
+ },
12
+ "sideEffects": false
13
+ }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- const typescript_eslint_1 = require("./rules/typescript-eslint");
3
- const unicorn_1 = require("./rules/unicorn");
4
- module.exports = {
5
- rules: {
6
- '@stylistic/ts/indent': ['warn', 4, {
7
- SwitchCase: 1,
8
- ignoredNodes: [
9
- 'TSTypeParameterInstantiation',
10
- ],
11
- }],
12
- '@typescript-eslint/naming-convention': ['error', ...(0, typescript_eslint_1.typescriptEslintNamingConvention)()],
13
- 'unicorn/prevent-abbreviations': ['warn', (0, unicorn_1.unicornPreventAbbreviations)()],
14
- },
15
- };
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typescriptEslintNamingConvention = typescriptEslintNamingConvention;
4
- const rules_1 = require("@perfective/eslint-config/rules");
5
- function typescriptEslintNamingConvention(extensions = []) {
6
- return (0, rules_1.typescriptEslintNamingConvention)([
7
- {
8
- selector: ['variable'],
9
- modifiers: ['const'],
10
- format: ['strictCamelCase', 'StrictPascalCase'],
11
- },
12
- {
13
- selector: ['function'],
14
- format: ['strictCamelCase', 'StrictPascalCase'],
15
- },
16
- ].concat(extensions));
17
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unicornPreventAbbreviations = unicornPreventAbbreviations;
4
- const rules_1 = require("@perfective/eslint-config/rules");
5
- function unicornPreventAbbreviations(replacements = {}, options = {}) {
6
- return (0, rules_1.unicornPreventAbbreviations)(Object.assign({ prop: false, props: false, ref: false, refs: false }, replacements), options);
7
- }
@@ -1,79 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- plugins: [
4
- 'jsx-a11y',
5
- ],
6
- rules: {
7
- 'jsx-a11y/accessible-emoji': 'error',
8
- 'jsx-a11y/alt-text': 'error',
9
- 'jsx-a11y/anchor-has-content': ['error', {
10
- components: [],
11
- }],
12
- 'jsx-a11y/anchor-is-valid': ['error', {
13
- components: [],
14
- specialLink: [],
15
- aspects: ['noHref', 'invalidHref', 'preferButton'],
16
- }],
17
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
18
- 'jsx-a11y/aria-props': 'error',
19
- 'jsx-a11y/aria-proptypes': 'error',
20
- 'jsx-a11y/aria-role': ['error', {
21
- allowedInvalidRoles: [],
22
- ignoreNonDOM: false,
23
- }],
24
- 'jsx-a11y/aria-unsupported-elements': 'error',
25
- 'jsx-a11y/autocomplete-valid': ['error', {
26
- inputComponents: [],
27
- }],
28
- 'jsx-a11y/click-events-have-key-events': 'error',
29
- 'jsx-a11y/heading-has-content': ['error', {
30
- components: [],
31
- }],
32
- 'jsx-a11y/html-has-lang': 'error',
33
- 'jsx-a11y/iframe-has-title': 'error',
34
- 'jsx-a11y/img-redundant-alt': ['error', {
35
- components: [],
36
- words: [],
37
- }],
38
- 'jsx-a11y/interactive-supports-focus': ['error', {
39
- tabbable: [],
40
- }],
41
- 'jsx-a11y/label-has-associated-control': ['error', {
42
- labelComponents: [],
43
- labelAttributes: [],
44
- controlComponents: [],
45
- assert: 'either',
46
- depth: 2,
47
- }],
48
- 'jsx-a11y/lang': 'error',
49
- 'jsx-a11y/media-has-caption': ['error', {
50
- audio: [],
51
- video: [],
52
- track: [],
53
- }],
54
- 'jsx-a11y/mouse-events-have-key-events': ['error', {
55
- hoverInHandlers: ['onMouseOver'],
56
- hoverOutHandlers: ['onMouseOut'],
57
- }],
58
- 'jsx-a11y/no-access-key': 'error',
59
- 'jsx-a11y/no-aria-hidden-on-focusable': 'error',
60
- 'jsx-a11y/no-autofocus': ['error', {
61
- ignoreNonDOM: false,
62
- }],
63
- 'jsx-a11y/no-distracting-elements': 'error',
64
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error',
65
- 'jsx-a11y/no-noninteractive-element-interactions': 'error',
66
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error',
67
- 'jsx-a11y/no-noninteractive-tabindex': 'error',
68
- 'jsx-a11y/no-onchange': 'error',
69
- 'jsx-a11y/no-redundant-roles': ['error', {
70
- nav: ['navigation'],
71
- }],
72
- 'jsx-a11y/no-static-element-interactions': 'error',
73
- 'jsx-a11y/prefer-tag-over-role': 'error',
74
- 'jsx-a11y/role-has-required-aria-props': 'error',
75
- 'jsx-a11y/role-supports-aria-props': 'error',
76
- 'jsx-a11y/scope': 'error',
77
- 'jsx-a11y/tabindex-no-positive': 'error',
78
- },
79
- };
@@ -1,159 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- plugins: [
4
- 'react',
5
- ],
6
- extends: [
7
- './jsx',
8
- ],
9
- rules: {
10
- 'react/boolean-prop-naming': ['error', {
11
- propTypeNames: ['bool'],
12
- rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+',
13
- validateNested: true,
14
- }],
15
- 'react/button-has-type': ['error', {
16
- button: true,
17
- submit: true,
18
- reset: true,
19
- }],
20
- 'react/checked-requires-onchange-or-readonly': 'error',
21
- 'react/default-props-match-prop-types': 'error',
22
- 'react/destructuring-assignment': ['error', 'never'],
23
- 'react/display-name': ['error', {
24
- checkContextObjects: true,
25
- ignoreTranspilerName: false,
26
- }],
27
- 'react/forbid-component-props': 'error',
28
- 'react/forbid-dom-props': ['error', {
29
- forbid: [],
30
- }],
31
- 'react/forbid-elements': ['error', {
32
- forbid: [],
33
- }],
34
- 'react/forbid-foreign-prop-types': 'error',
35
- 'react/forbid-prop-types': ['error', {
36
- forbid: ['any', 'array', 'object'],
37
- checkContextTypes: true,
38
- checkChildContextTypes: true,
39
- }],
40
- 'react/forward-ref-uses-ref': 'error',
41
- 'react/function-component-definition': ['warn', {
42
- namedComponents: 'function-declaration',
43
- unnamedComponents: 'function-expression',
44
- }],
45
- 'react/hook-use-state': ['error', {
46
- allowDestructuredState: false,
47
- }],
48
- 'react/iframe-missing-sandbox': 'error',
49
- 'react/no-access-state-in-setstate': 'error',
50
- 'react/no-adjacent-inline-elements': 'error',
51
- 'react/no-array-index-key': 'error',
52
- 'react/no-arrow-function-lifecycle': 'warn',
53
- 'react/no-children-prop': ['error', {
54
- allowFunctions: false,
55
- }],
56
- 'react/no-danger': 'error',
57
- 'react/no-danger-with-children': 'error',
58
- 'react/no-deprecated': 'error',
59
- 'react/no-did-mount-set-state': ['error', 'disallow-in-func'],
60
- 'react/no-did-update-set-state': ['error', 'disallow-in-func'],
61
- 'react/no-direct-mutation-state': 'error',
62
- 'react/no-find-dom-node': 'error',
63
- 'react/no-invalid-html-attribute': 'warn',
64
- 'react/no-is-mounted': 'error',
65
- 'react/no-multi-comp': ['error', {
66
- ignoreStateless: false,
67
- }],
68
- 'react/no-namespace': 'error',
69
- 'react/no-object-type-as-default-prop': 'error',
70
- 'react/no-redundant-should-component-update': 'error',
71
- 'react/no-render-return-value': 'error',
72
- 'react/no-set-state': 'off',
73
- 'react/no-string-refs': ['error', {
74
- noTemplateLiterals: true,
75
- }],
76
- 'react/no-this-in-sfc': 'error',
77
- 'react/no-typos': 'error',
78
- 'react/no-unescaped-entities': ['error', {
79
- forbid: ['>', '}'],
80
- }],
81
- 'react/no-unknown-property': ['warn', {
82
- ignore: [],
83
- requireDataLowercase: true,
84
- }],
85
- 'react/no-unsafe': 'error',
86
- 'react/no-unstable-nested-components': ['error', {
87
- allowAsProps: false,
88
- }],
89
- 'react/no-unused-prop-types': 'error',
90
- 'react/no-unused-state': 'error',
91
- 'react/no-will-update-set-state': ['error', 'disallow-in-func'],
92
- 'react/prefer-es6-class': ['error', 'always'],
93
- 'react/prefer-exact-props': 'off',
94
- 'react/prefer-read-only-props': 'warn',
95
- 'react/prefer-stateless-function': 'off',
96
- 'react/prop-types': 'error',
97
- 'react/react-in-jsx-scope': 'error',
98
- 'react/require-default-props': 'error',
99
- 'react/require-optimization': ['error', {
100
- allowDecorators: [],
101
- }],
102
- 'react/require-render-return': 'error',
103
- 'react/self-closing-comp': ['warn', {
104
- component: true,
105
- html: true,
106
- }],
107
- 'react/sort-comp': ['error', {
108
- order: [
109
- 'static-methods',
110
- 'lifecycle',
111
- 'everything-else',
112
- 'render',
113
- ],
114
- groups: {
115
- lifecycle: [
116
- 'displayName',
117
- 'propTypes',
118
- 'contextTypes',
119
- 'childContextTypes',
120
- 'mixins',
121
- 'statics',
122
- 'defaultProps',
123
- 'constructor',
124
- 'getDefaultProps',
125
- 'state',
126
- 'getInitialState',
127
- 'getChildContext',
128
- 'getDerivedStateFromProps',
129
- 'componentWillMount',
130
- 'UNSAFE_componentWillMount',
131
- 'componentDidMount',
132
- 'componentWillReceiveProps',
133
- 'UNSAFE_componentWillReceiveProps',
134
- 'shouldComponentUpdate',
135
- 'componentWillUpdate',
136
- 'UNSAFE_componentWillUpdate',
137
- 'getSnapshotBeforeUpdate',
138
- 'componentDidUpdate',
139
- 'componentDidCatch',
140
- 'componentWillUnmount',
141
- ],
142
- },
143
- }],
144
- 'react/sort-default-props': ['error', {
145
- ignoreCase: false,
146
- }],
147
- 'react/sort-prop-types': ['error', {
148
- ignoreCase: false,
149
- callbacksLast: true,
150
- requiredFirst: true,
151
- sortShapeProp: true,
152
- noSortAlphabetically: false,
153
- }],
154
- 'react/state-in-constructor': ['error', 'always'],
155
- 'react/static-property-placement': ['error', 'static public field'],
156
- 'react/style-prop-object': 'error',
157
- 'react/void-dom-elements-no-children': 'error',
158
- },
159
- };
@@ -1,91 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- rules: {
4
- 'react/jsx-boolean-value': ['warn', 'always'],
5
- 'react/jsx-child-element-spacing': 'off',
6
- 'react/jsx-closing-bracket-location': 'off',
7
- 'react/jsx-closing-tag-location': 'off',
8
- 'react/jsx-curly-brace-presence': 'off',
9
- 'react/jsx-curly-newline': 'off',
10
- 'react/jsx-curly-spacing': 'off',
11
- 'react/jsx-equals-spacing': 'off',
12
- 'react/jsx-filename-extension': ['error', {
13
- allow: 'always',
14
- extensions: ['.jsx', '.tsx'],
15
- ignoreFilesWithoutCode: false,
16
- }],
17
- 'react/jsx-first-prop-new-line': 'off',
18
- 'react/jsx-fragments': ['warn', 'element'],
19
- 'react/jsx-handler-names': ['error', {
20
- eventHandlerPrefix: 'handle',
21
- eventHandlerPropPrefix: 'on',
22
- checkLocalVariables: true,
23
- checkInlineFunction: true,
24
- }],
25
- 'react/jsx-indent': 'off',
26
- 'react/jsx-indent-props': 'off',
27
- 'react/jsx-key': ['error', {
28
- checkFragmentShorthand: true,
29
- checkKeyMustBeforeSpread: true,
30
- warnOnDuplicates: true,
31
- }],
32
- 'react/jsx-max-depth': ['error', {
33
- max: 4,
34
- }],
35
- 'react/jsx-max-props-per-line': 'off',
36
- 'react/jsx-newline': 'off',
37
- 'react/jsx-no-bind': ['error', {
38
- ignoreDOMComponents: false,
39
- ignoreRefs: false,
40
- allowArrowFunctions: false,
41
- allowFunctions: false,
42
- }],
43
- 'react/jsx-no-comment-textnodes': 'error',
44
- 'react/jsx-no-constructed-context-values': 'error',
45
- 'react/jsx-no-duplicate-props': ['error', {
46
- ignoreCase: true,
47
- }],
48
- 'react/jsx-no-leaked-render': ['warn', {
49
- validStrategies: ['ternary'],
50
- }],
51
- 'react/jsx-no-literals': ['error', {
52
- noStrings: false,
53
- allowedStrings: [],
54
- ignoreProps: true,
55
- noAttributeStrings: false,
56
- }],
57
- 'react/jsx-props-no-spread-multi': 'error',
58
- 'react/jsx-no-script-url': ['error', {
59
- includeFromSettings: false,
60
- }],
61
- 'react/jsx-no-target-blank': ['warn', {
62
- allowReferrer: false,
63
- enforceDynamicLinks: 'always',
64
- forms: true,
65
- links: true,
66
- warnOnSpreadAttributes: true,
67
- }],
68
- 'react/jsx-no-undef': ['error', {
69
- allowGlobals: false,
70
- }],
71
- 'react/jsx-no-useless-fragment': ['warn', {
72
- allowExpressions: true,
73
- }],
74
- 'react/jsx-one-expression-per-line': 'off',
75
- 'react/jsx-pascal-case': 'off',
76
- 'react/jsx-props-no-multi-spaces': 'off',
77
- 'react/jsx-props-no-spreading': ['error', {
78
- html: 'enforce',
79
- custom: 'enforce',
80
- explicitSpread: 'enforce',
81
- exceptions: [],
82
- }],
83
- 'react/jsx-sort-default-props': 'off',
84
- 'react/jsx-sort-props': 'off',
85
- 'react/jsx-space-before-closing': 'off',
86
- 'react/jsx-tag-spacing': 'off',
87
- 'react/jsx-uses-react': 'error',
88
- 'react/jsx-uses-vars': 'error',
89
- 'react/jsx-wrap-multilines': 'off',
90
- },
91
- };
@@ -1,10 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- plugins: [
4
- 'react-hooks',
5
- ],
6
- rules: {
7
- 'react-hooks/rules-of-hooks': 'error',
8
- 'react-hooks/exhaustive-deps': 'warn',
9
- },
10
- };