@paratco/eslint-config 1.0.15 → 2.1.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 (54) hide show
  1. package/dist/configs/base.d.ts +124 -0
  2. package/dist/configs/base.d.ts.map +1 -0
  3. package/dist/configs/base.js +21 -0
  4. package/dist/configs/import.d.ts +83 -0
  5. package/dist/configs/import.d.ts.map +1 -0
  6. package/dist/configs/import.js +41 -0
  7. package/dist/configs/node.d.ts +203 -0
  8. package/dist/configs/node.d.ts.map +1 -0
  9. package/{src → dist}/configs/node.js +3 -5
  10. package/dist/configs/prettierFormatter.d.ts +4 -0
  11. package/dist/configs/prettierFormatter.d.ts.map +1 -0
  12. package/{src → dist}/configs/prettierFormatter.js +0 -1
  13. package/dist/configs/react.d.ts +2863 -0
  14. package/dist/configs/react.d.ts.map +1 -0
  15. package/dist/configs/react.js +51 -0
  16. package/dist/configs/stylisticFormatter.d.ts +218 -0
  17. package/dist/configs/stylisticFormatter.d.ts.map +1 -0
  18. package/dist/configs/stylisticFormatter.js +29 -0
  19. package/dist/index.d.ts +3484 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +14 -0
  22. package/dist/rules/import.d.ts +59 -0
  23. package/dist/rules/import.d.ts.map +1 -0
  24. package/dist/rules/import.js +139 -0
  25. package/dist/rules/javascript.d.ts +23 -0
  26. package/dist/rules/javascript.d.ts.map +1 -0
  27. package/dist/rules/javascript.js +42 -0
  28. package/dist/rules/react.d.ts +112 -0
  29. package/dist/rules/react.d.ts.map +1 -0
  30. package/dist/rules/react.js +330 -0
  31. package/dist/rules/stylistic.d.ts +208 -0
  32. package/dist/rules/stylistic.d.ts.map +1 -0
  33. package/dist/rules/stylistic.js +439 -0
  34. package/dist/rules/typescript.d.ts +96 -0
  35. package/dist/rules/typescript.d.ts.map +1 -0
  36. package/dist/rules/typescript.js +254 -0
  37. package/package.json +25 -12
  38. package/.github/dependabot.yml +0 -14
  39. package/.github/workflows/publish.yml +0 -52
  40. package/.prettierrc.json +0 -22
  41. package/.yarnrc.yml +0 -1
  42. package/index.js +0 -15
  43. package/prettier/README.md +0 -22
  44. package/prettier/index.json +0 -22
  45. package/prettier/package.json +0 -20
  46. package/src/configs/base.js +0 -25
  47. package/src/configs/import.js +0 -43
  48. package/src/configs/react.js +0 -58
  49. package/src/configs/stylisticFormatter.js +0 -33
  50. package/src/lints/import/index.js +0 -175
  51. package/src/lints/javascript/index.js +0 -37
  52. package/src/lints/react/index.js +0 -425
  53. package/src/lints/stylistic/index.js +0 -529
  54. package/src/lints/typescript/index.js +0 -295
@@ -1,175 +0,0 @@
1
- export default {
2
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md
3
- // Forbid imported names marked with @deprecated documentation tag.
4
- "import-x/no-deprecated": ["error"],
5
-
6
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-empty-named-blocks.md
7
- // Forbid empty named import blocks.
8
- "import-x/no-empty-named-blocks": ["warn"],
9
-
10
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
11
- // Forbid the use of extraneous packages.
12
- "import-x/no-extraneous-dependencies": [
13
- "error",
14
- { devDependencies: false, optionalDependencies: false, peerDependencies: false }
15
- ],
16
-
17
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
18
- // Forbid the use of mutable exports with var or let.
19
- "import-x/no-mutable-exports": ["error"],
20
-
21
- // https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/docs/rules/no-rename-default.md
22
- // Prohibit importing a default export by another name.
23
- "import-x/no-rename-default": ["off"],
24
-
25
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md
26
- // Forbid modules without exports, or exports without matching import in another module.
27
- // TODO: Can be enabled
28
- "import-x/no-unused-modules": ["off", { missingExports: true }],
29
-
30
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md
31
- // Forbid AMD require and define calls.
32
- "import-x/no-amd": ["error"],
33
-
34
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md
35
- // Forbid CommonJS require calls and module.exports or exports.*.
36
- "import-x/no-commonjs": ["error"],
37
-
38
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md
39
- // Forbid import statements with CommonJS module.exports.
40
- "import-x/no-import-module-exports": ["warn"],
41
-
42
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md
43
- // Forbid Node.js builtin modules.
44
- // TODO: Can enable for front-end
45
- "import-x/no-nodejs-modules": ["off"],
46
-
47
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md
48
- // Forbid potentially ambiguous parse goal (script vs. module).
49
- "import-x/unambiguous": ["error"],
50
-
51
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
52
- // Forbid import of modules using absolute paths.
53
- "import-x/no-absolute-path": ["warn"],
54
-
55
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
56
- // Forbid a module from importing a module with a dependency path back to itself.
57
- "import-x/no-cycle": ["error"],
58
-
59
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md
60
- // Forbid require() calls with expressions.
61
- "import-x/no-dynamic-require": ["off"],
62
-
63
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md
64
- // Forbid importing the submodules of other modules.
65
- // TODO: Must define in the project
66
- "import-x/no-internal-modules": ["off"],
67
-
68
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
69
- // Forbid importing packages through relative paths.
70
- "import-x/no-relative-packages": ["warn"],
71
-
72
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md
73
- // Forbid importing modules from parent directories.
74
- "import-x/no-relative-parent-imports": ["off"],
75
-
76
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md
77
- // Enforce which files can be imported in a given folder.
78
- // TODO: Can be customized
79
- // "import-x/no-restricted-paths": ["off"],
80
-
81
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
82
- // Forbid a module from importing itself.
83
- "import-x/no-self-import": ["error"],
84
-
85
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
86
- // Forbid unnecessary path segments in import and require statements.
87
- "import-x/no-useless-path-segments": [
88
- "warn",
89
- {
90
- noUselessIndex: true
91
- }
92
- ],
93
-
94
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md
95
- // Forbid webpack loader syntax in imports.
96
- "import-x/no-webpack-loader-syntax": ["error"],
97
-
98
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
99
- // Enforce or ban the use of inline type-only markers for named imports.
100
- "import-x/consistent-type-specifier-style": ["warn", "prefer-top-level"],
101
-
102
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md
103
- // Enforce a leading comment with the webpackChunkName for dynamic imports.
104
- "import-x/dynamic-import-chunkname": ["off"],
105
-
106
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
107
- // Ensure all exports appear after other statements.
108
- // TODO: Can be enabled
109
- "import-x/exports-last": ["off"],
110
-
111
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
112
- // Ensure consistent use of file extension within the import path.
113
- "import-x/extensions": ["error", "never"],
114
-
115
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
116
- // Ensure all imports appear before other statements.
117
- "import-x/first": ["warn"],
118
-
119
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md
120
- // Prefer named exports to be grouped together in a single export declaration
121
- // TODO: Can be enabled
122
- "import-x/group-exports": ["off"],
123
-
124
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md
125
- // Enforce the maximum number of dependencies a module can have.
126
- "import-x/max-dependencies": ["off"],
127
-
128
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
129
- // Enforce a newline after import statements.
130
- "import-x/newline-after-import": ["warn"],
131
-
132
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-anonymous-default-export.md
133
- // Forbid anonymous values as default exports.
134
- "import-x/no-anonymous-default-export": [
135
- "error",
136
- {
137
- allowArray: false,
138
- allowArrowFunction: true,
139
- allowAnonymousClass: false,
140
- allowAnonymousFunction: false,
141
- allowCallExpression: true, // The true value here is for backward compatibility
142
- allowNew: false,
143
- allowLiteral: false,
144
- allowObject: false
145
- }
146
- ],
147
-
148
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
149
- // Forbid default exports.
150
- "import-x/no-default-export": ["off"],
151
-
152
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md
153
- // Forbid named default exports.
154
- "import-x/no-named-default": ["off"],
155
-
156
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-export.md
157
- // Forbid named exports.
158
- "import-x/no-named-export": ["off"],
159
-
160
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-namespace.md
161
- // Forbid namespace (a.k.a. "wildcard" *) imports.
162
- "import-x/no-namespace": ["warn"],
163
-
164
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unassigned-import.md
165
- // Forbid unassigned imports
166
- "import-x/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
167
-
168
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
169
- // Enforce a convention in module import order.
170
- "import-x/order": ["warn"],
171
-
172
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md
173
- // Prefer a default export if module exports a single name or multiple names.
174
- "import-x/prefer-default-export": ["off"]
175
- };
@@ -1,37 +0,0 @@
1
- export default {
2
- // https://eslint.org/docs/latest/rules/eqeqeq
3
- // Require the use of === and !==
4
- eqeqeq: ["warn"],
5
-
6
- // https://eslint.org/docs/latest/rules/curly
7
- // Enforce consistent brace style for all control statements
8
- curly: ["warn", "all"],
9
-
10
- // https://eslint.org/docs/latest/rules/no-restricted-imports
11
- // Disallow specified modules when loaded by import
12
- "no-restricted-imports": [
13
- "error",
14
- {
15
- patterns: [
16
- {
17
- regex: "^(node:)?process$",
18
- message: "Please dont import node:process."
19
- }
20
- ]
21
- }
22
- ],
23
-
24
- // https://eslint.org/docs/latest/rules/no-unused-vars
25
- // Disallow unused variables
26
- "no-unused-vars": [
27
- "error",
28
- {
29
- args: "all",
30
- argsIgnorePattern: "^_",
31
- caughtErrors: "all",
32
- caughtErrorsIgnorePattern: "^_",
33
- destructuredArrayIgnorePattern: "^_",
34
- ignoreRestSiblings: true
35
- }
36
- ]
37
- };
@@ -1,425 +0,0 @@
1
- export default {
2
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md
3
- // Enforces consistent naming for boolean props
4
- "react/boolean-prop-naming": ["error"],
5
-
6
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
7
- // Disallow usage of button elements without an explicit type attribute
8
- "react/button-has-type": ["error"],
9
-
10
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/checked-requires-onchange-or-readonly.md
11
- // Enforce using onChange or readonly attribute when checked is used
12
- "react/checked-requires-onchange-or-readonly": ["off"],
13
-
14
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/default-props-match-prop-types.md
15
- // Enforce all defaultProps have a corresponding non-required PropType
16
- "react/default-props-match-prop-types": ["error"],
17
-
18
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
19
- // Enforce consistent usage of destructuring assignment of props, state, and context
20
- "react/destructuring-assignment": ["warn"],
21
-
22
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
23
- // Disallow missing displayName in a React component definition
24
- "react/display-name": ["error"],
25
-
26
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md
27
- // Disallow certain props on components
28
- "react/forbid-component-props": ["off"],
29
-
30
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-dom-props.md
31
- // Disallow certain props on DOM Nodes
32
- "react/forbid-dom-props": ["off"],
33
-
34
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md
35
- // Disallow certain elements
36
- "react/forbid-elements": ["off"],
37
-
38
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md
39
- // Disallow using another component's propTypes
40
- "react/forbid-foreign-prop-types": ["error"],
41
-
42
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
43
- // Disallow certain propTypes
44
- "react/forbid-prop-types": ["error"],
45
-
46
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
47
- // Enforce a specific function type for function components
48
- "react/function-component-definition": ["warn"],
49
-
50
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
51
- // Ensure destructuring and symmetric naming of useState hook value and setter variables
52
- "react/hook-use-state": ["error"],
53
-
54
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/iframe-missing-sandbox.md
55
- // Enforce sandbox attribute on iframe elements
56
- "react/iframe-missing-sandbox": ["error"],
57
-
58
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
59
- // Enforce boolean attributes notation in JSX
60
- "react/jsx-boolean-value": ["warn", "always"],
61
-
62
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
63
- // Enforce or disallow spaces inside curly braces in JSX attributes and expressions
64
- "react/jsx-child-element-spacing": ["error"],
65
-
66
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
67
- // Enforce closing bracket location in JSX
68
- // Use similar stylistic rule instead
69
- "react/jsx-closing-bracket-location": ["off"],
70
-
71
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
72
- // Enforce closing tag location for multiline JSX
73
- // Use similar stylistic rule instead
74
- "react/jsx-closing-tag-location": ["off"],
75
-
76
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
77
- // Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
78
- // Use similar stylistic rule instead
79
- "react/jsx-curly-brace-presence": ["off"],
80
-
81
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
82
- // Enforce consistent linebreaks in curly braces in JSX attributes and expressions
83
- // Use similar stylistic rule instead
84
- "react/jsx-curly-newline": ["off"],
85
-
86
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
87
- // Enforce or disallow spaces inside curly braces in JSX attributes and expressions
88
- // Use similar stylistic rule instead
89
- "react/jsx-curly-spacing": ["off"],
90
-
91
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
92
- // Enforce or disallow spaces around equal signs in JSX attributes
93
- // Use similar stylistic rule instead
94
- "react/jsx-equals-spacing": ["off"],
95
-
96
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
97
- // Disallow file extensions that may contain JSX
98
- "react/jsx-filename-extension": ["error", { allow: "always", extensions: [".tsx"] }],
99
-
100
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
101
- // Enforce proper position of the first property in JSX
102
- // Use similar stylistic rule instead
103
- "react/jsx-first-prop-new-line": ["off"],
104
-
105
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
106
- // Enforce shorthand or standard form for React fragments
107
- "react/jsx-fragments": ["warn"],
108
-
109
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
110
- // Enforce event handler naming conventions in JSX
111
- "react/jsx-handler-names": ["error"],
112
-
113
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
114
- // Enforce JSX indentation
115
- // Use similar stylistic rule instead
116
- "react/jsx-indent": ["off"],
117
-
118
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
119
- // Enforce props indentation in JSX
120
- // Use similar stylistic rule instead
121
- "react/jsx-indent-props": ["off"],
122
-
123
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
124
- // Disallow missing key props in iterators/collection literals
125
- "react/jsx-key": ["error"],
126
-
127
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
128
- // Enforce JSX maximum depth
129
- "react/jsx-max-depth": ["off"],
130
-
131
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
132
- // Enforce maximum of props on a single line in JSX
133
- // Use similar stylistic rule instead
134
- "react/jsx-max-props-per-line": ["off"],
135
-
136
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
137
- // Require or prevent a new line after jsx elements and expressions
138
- // Use similar stylistic rule instead
139
- "react/jsx-newline": ["off"],
140
-
141
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
142
- // Disallow .bind() or arrow functions in JSX props
143
- "react/jsx-no-bind": [
144
- "error",
145
- {
146
- allowArrowFunctions: true
147
- }
148
- ],
149
-
150
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
151
- // Disallow comments from being inserted as text nodes
152
- "react/jsx-no-comment-textnodes": ["error"],
153
-
154
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
155
- // Disallows JSX context provider values from taking values that will cause needless renders
156
- "react/jsx-no-constructed-context-values": ["error"],
157
-
158
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
159
- // Disallow duplicate properties in JSX
160
- "react/jsx-no-duplicate-props": ["error"],
161
-
162
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
163
- // Disallow problematic leaked values from being rendered
164
- "react/jsx-no-leaked-render": ["warn"],
165
-
166
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
167
- // Disallow usage of string literals in JSX
168
- "react/jsx-no-literals": ["off"],
169
-
170
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
171
- // Disallow usage of javascript: URLs
172
- "react/jsx-no-script-url": ["error"],
173
-
174
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
175
- // Disallow target="_blank" attribute without rel="noreferrer"
176
- "react/jsx-no-target-blank": ["warn"],
177
-
178
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
179
- // Disallow undeclared variables in JSX
180
- "react/jsx-no-undef": ["error"],
181
-
182
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
183
- // Disallow unnecessary fragments
184
- "react/jsx-no-useless-fragment": ["warn"],
185
-
186
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
187
- // Require one JSX element per line
188
- // Use similar stylistic rule instead
189
- "react/jsx-one-expression-per-line": ["off"],
190
-
191
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
192
- // Enforce PascalCase for user-defined JSX components
193
- // Use similar stylistic rule instead
194
- "react/jsx-pascal-case": ["off"],
195
-
196
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
197
- // Disallow multiple spaces between inline JSX props
198
- // Use similar stylistic rule instead
199
- "react/jsx-props-no-multi-spaces": ["off"],
200
-
201
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spread-multi.md
202
- // Disallow multiple spaces between inline JSX props
203
- "react/jsx-props-no-spread-multi": ["off"],
204
-
205
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
206
- // Disallow JSX prop spreading
207
- "react/jsx-props-no-spreading": ["off"],
208
-
209
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
210
- // Enforce props alphabetical sorting
211
- // Use similar stylistic rule instead
212
- "react/jsx-sort-props": ["off"],
213
-
214
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
215
- // Enforce whitespace in and around the JSX opening and closing brackets
216
- // Use similar stylistic rule instead
217
- "react/jsx-tag-spacing": ["off"],
218
-
219
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
220
- // Disallow React to be incorrectly marked as unused
221
- "react/jsx-uses-react": ["error"],
222
-
223
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
224
- // Disallow variables used in JSX to be incorrectly marked as unused
225
- "react/jsx-uses-vars": ["error"],
226
-
227
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
228
- // Disallow missing parentheses around multiline JSX
229
- // Use similar stylistic rule instead
230
- "react/jsx-wrap-multilines": ["off"],
231
-
232
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
233
- // Disallow when this.state is accessed within setState
234
- "react/no-access-state-in-setstate": ["error"],
235
-
236
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md
237
- // Disallow adjacent inline elements not separated by whitespace.
238
- "react/no-adjacent-inline-elements": ["error"],
239
-
240
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
241
- // Disallow usage of Array index in keys
242
- "react/no-array-index-key": ["error"],
243
-
244
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-arrow-function-lifecycle.md
245
- // Lifecycle methods should be methods on the prototype, not class fields
246
- "react/no-arrow-function-lifecycle": ["warn"],
247
-
248
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md
249
- // Disallow passing of children as props
250
- "react/no-children-prop": ["error"],
251
-
252
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-danger.md
253
- // Disallow usage of dangerous JSX properties
254
- "react/no-danger": ["error"],
255
-
256
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md
257
- // Disallow when a DOM element is using both children and dangerouslySetInnerHTML
258
- "react/no-danger-with-children": ["error"],
259
-
260
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
261
- // Disallow usage of deprecated methods
262
- "react/no-deprecated": ["error"],
263
-
264
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
265
- // Disallow usage of setState in componentDidMount
266
- "react/no-did-mount-set-state": ["error", "disallow-in-func"],
267
-
268
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
269
- // Disallow usage of setState in componentDidUpdate
270
- "react/no-did-update-set-state": ["error", "disallow-in-func"],
271
-
272
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
273
- // Disallow direct mutation of this.state
274
- "react/no-direct-mutation-state": ["error"],
275
-
276
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
277
- // Disallow usage of findDOMNode
278
- "react/no-find-dom-node": ["error"],
279
-
280
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-invalid-html-attribute.md
281
- // Disallow usage of invalid attributes
282
- "react/no-invalid-html-attribute": ["error"],
283
-
284
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md
285
- // Disallow usage of isMounted
286
- "react/no-is-mounted": ["error"],
287
-
288
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
289
- // Disallow multiple component definition per file
290
- "react/no-multi-comp": ["off"],
291
-
292
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-namespace.md
293
- // Enforce that namespaces are not used in React elements
294
- "react/no-namespace": ["error"],
295
-
296
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-object-type-as-default-prop.md
297
- // Disallow usage of referential-type variables as default param in functional component
298
- "react/no-object-type-as-default-prop": ["error"],
299
-
300
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-redundant-should-component-update.md
301
- // Disallow usage of shouldComponentUpdate when extending React.PureComponent
302
- "react/no-redundant-should-component-update": ["error"],
303
-
304
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
305
- // Disallow usage of the return value of ReactDOM.render
306
- "react/no-render-return-value": ["error"],
307
-
308
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
309
- // Disallow usage of setState
310
- "react/no-set-state": ["error"],
311
-
312
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md
313
- // Disallow using string references
314
- "react/no-string-refs": ["error", { noTemplateLiterals: true }],
315
-
316
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
317
- // Disallow this from being used in stateless functional components
318
- "react/no-this-in-sfc": ["error"],
319
-
320
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-typos.md
321
- // Disallow common typos
322
- "react/no-typos": ["error"],
323
-
324
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
325
- // Disallow unescaped HTML entities from appearing in markup
326
- "react/no-unescaped-entities": ["error"],
327
-
328
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
329
- // Disallow usage of unknown DOM property
330
- "react/no-unknown-property": ["warn"],
331
-
332
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
333
- // Disallow usage of unsafe lifecycle methods
334
- // Disabled in recommended configs
335
- "react/no-unsafe": ["off"],
336
-
337
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
338
- // Disallow creating unstable components inside components
339
- "react/no-unstable-nested-components": ["error"],
340
-
341
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unused-class-component-methods.md
342
- // Disallow declaring unused methods of component class
343
- "react/no-unused-class-component-methods": ["error"],
344
-
345
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md
346
- // Disallow definitions of unused propTypes
347
- "react/no-unused-prop-types": ["error"],
348
-
349
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
350
- // Disallow definitions of unused state
351
- "react/no-unused-state": ["error"],
352
-
353
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md
354
- // Disallow usage of setState in componentWillUpdate
355
- "react/no-will-update-set-state": ["error", "disallow-in-func"],
356
-
357
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
358
- // Enforce ES5 or ES6 class for React Components
359
- "react/prefer-es6-class": ["error"],
360
-
361
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-exact-props.md
362
- // Prefer exact prop type definitions
363
- "react/prefer-exact-props": ["error"],
364
-
365
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md
366
- // Enforce that props are read-only
367
- "react/prefer-read-only-props": ["warn"],
368
-
369
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
370
- // Enforce stateless components to be written as a pure function
371
- "react/prefer-stateless-function": ["error"],
372
-
373
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prop-types.md
374
- // Disallow missing props validation in a React component definition
375
- "react/prop-types": ["error"],
376
-
377
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
378
- // Disallow missing React when using JSX
379
- // Disable this rule because react 17 doesn't need to import React to use JSX
380
- "react/react-in-jsx-scope": ["off"],
381
-
382
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
383
- // Enforce a defaultProps definition for every prop that is not a required prop
384
- "react/require-default-props": ["off"],
385
-
386
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-optimization.md
387
- // Enforce React components to have a shouldComponentUpdate method
388
- "react/require-optimization": ["error"],
389
-
390
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
391
- // Enforce ES5 or ES6 class for returning value in render function
392
- "react/require-render-return": ["error"],
393
-
394
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
395
- // Disallow extra closing tags for components without children
396
- "react/self-closing-comp": ["warn"],
397
-
398
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
399
- // Enforce component methods order
400
- "react/sort-comp": ["error"],
401
-
402
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
403
- // Enforce defaultProps declarations alphabetical sorting
404
- "react/sort-default-props": ["off"],
405
-
406
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md
407
- // Enforce propTypes declarations alphabetical sorting
408
- "react/sort-prop-types": ["off"],
409
-
410
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
411
- // Enforce class component state initialization style
412
- "react/state-in-constructor": ["error"],
413
-
414
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
415
- // Enforces where React component static properties should be positioned.
416
- "react/static-property-placement": ["error"],
417
-
418
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
419
- // Enforce style prop value is an object
420
- "react/style-prop-object": ["error"],
421
-
422
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
423
- // Disallow void DOM elements (e.g. <img />, <br />) from receiving children
424
- "react/void-dom-elements-no-children": ["error"]
425
- };