Skip to content

Commit 68acdb5

Browse files
authored
Fix 'all' preset, closes #1260 (#1261)
1 parent 6fef40f commit 68acdb5

File tree

7 files changed

+55
-35
lines changed

7 files changed

+55
-35
lines changed

examples/react-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"react-dom": "^19.2.0"
1616
},
1717
"devDependencies": {
18-
"@eslint-react/eslint-plugin": "2.0.4",
18+
"@eslint-react/eslint-plugin": "workspace:*",
1919
"@eslint/config-inspector": "^1.3.0",
2020
"@eslint/js": "^9.36.0",
2121
"@tsconfig/node22": "^22.0.2",

packages/plugins/eslint-plugin-react-x/src/configs/recommended.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ export const name = "react-x/recommended";
66
export const rules = {
77
"react-x/jsx-no-comment-textnodes": "warn",
88
"react-x/jsx-no-duplicate-props": "warn",
9+
"react-x/jsx-no-iife": "off",
10+
"react-x/jsx-no-undef": "off",
11+
"react-x/jsx-shorthand-boolean": "off",
12+
"react-x/jsx-shorthand-fragment": "off",
913
"react-x/jsx-uses-react": "warn",
1014
"react-x/jsx-uses-vars": "warn",
1115
"react-x/no-access-state-in-setstate": "error",
@@ -14,7 +18,9 @@ export const rules = {
1418
"react-x/no-children-for-each": "warn",
1519
"react-x/no-children-map": "warn",
1620
"react-x/no-children-only": "warn",
21+
"react-x/no-children-prop": "off",
1722
"react-x/no-children-to-array": "warn",
23+
"react-x/no-class-component": "off",
1824
"react-x/no-clone-element": "warn",
1925
"react-x/no-component-will-mount": "error",
2026
"react-x/no-component-will-receive-props": "error",
@@ -24,9 +30,14 @@ export const rules = {
2430
"react-x/no-default-props": "error",
2531
"react-x/no-direct-mutation-state": "error",
2632
"react-x/no-duplicate-key": "error",
33+
"react-x/no-forbidden-props": "off",
2734
"react-x/no-forward-ref": "warn",
2835
"react-x/no-implicit-key": "warn",
36+
"react-x/no-leaked-conditional-rendering": "off",
37+
"react-x/no-missing-component-display-name": "off",
38+
"react-x/no-missing-context-display-name": "off",
2939
"react-x/no-missing-key": "error",
40+
"react-x/no-misused-capture-owner-stack": "off",
3041
"react-x/no-nested-component-definitions": "error",
3142
"react-x/no-nested-lazy-component-declarations": "error",
3243
"react-x/no-prop-types": "error",
@@ -35,16 +46,24 @@ export const rules = {
3546
"react-x/no-set-state-in-component-did-update": "warn",
3647
"react-x/no-set-state-in-component-will-update": "warn",
3748
"react-x/no-string-refs": "error",
49+
"react-x/no-unnecessary-key": "off",
50+
"react-x/no-unnecessary-use-callback": "off",
51+
"react-x/no-unnecessary-use-memo": "off",
3852
"react-x/no-unnecessary-use-prefix": "warn",
3953
"react-x/no-unsafe-component-will-mount": "warn",
4054
"react-x/no-unsafe-component-will-receive-props": "warn",
4155
"react-x/no-unsafe-component-will-update": "warn",
4256
"react-x/no-unstable-context-value": "warn",
4357
"react-x/no-unstable-default-props": "warn",
4458
"react-x/no-unused-class-component-members": "warn",
59+
"react-x/no-unused-props": "off",
4560
"react-x/no-unused-state": "warn",
4661
"react-x/no-use-context": "warn",
4762
"react-x/no-useless-forward-ref": "warn",
63+
"react-x/no-useless-fragment": "off",
64+
"react-x/prefer-destructuring-assignment": "off",
65+
"react-x/prefer-namespace-import": "off",
66+
"react-x/prefer-read-only-props": "off",
4867
"react-x/prefer-use-state-lazy-initialization": "warn",
4968
} as const satisfies Record<string, RuleConfig>;
5069

packages/plugins/eslint-plugin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ export default defineConfig([
169169

170170
Contributions are welcome!
171171

172-
Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/main/.github/CONTRIBUTING.md).
172+
Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/fix-presets/.github/CONTRIBUTING.md).
173173

174174
## License
175175

176-
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/main/LICENSE) file for details.
176+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/fix-presets/LICENSE) file for details.

packages/plugins/eslint-plugin/src/configs/all.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const rules = {
1919
"@eslint-react/jsx-shorthand-fragment": "warn",
2020
"@eslint-react/jsx-uses-react": "warn",
2121
"@eslint-react/jsx-uses-vars": "warn",
22-
2322
"@eslint-react/no-access-state-in-setstate": "error",
2423
"@eslint-react/no-array-index-key": "warn",
2524
"@eslint-react/no-children-count": "warn",
@@ -38,9 +37,10 @@ export const rules = {
3837
"@eslint-react/no-default-props": "error",
3938
"@eslint-react/no-direct-mutation-state": "error",
4039
"@eslint-react/no-duplicate-key": "error",
40+
"@eslint-react/no-forbidden-props": "off",
4141
"@eslint-react/no-forward-ref": "warn",
4242
"@eslint-react/no-implicit-key": "warn",
43-
// "@eslint-react/no-leaked-conditional-rendering": "warn",
43+
"@eslint-react/no-leaked-conditional-rendering": "off",
4444
"@eslint-react/no-missing-component-display-name": "warn",
4545
"@eslint-react/no-missing-context-display-name": "warn",
4646
"@eslint-react/no-missing-key": "error",
@@ -63,19 +63,16 @@ export const rules = {
6363
"@eslint-react/no-unstable-context-value": "warn",
6464
"@eslint-react/no-unstable-default-props": "warn",
6565
"@eslint-react/no-unused-class-component-members": "warn",
66-
// "@eslint-react/no-unused-props": "warn",
66+
"@eslint-react/no-unused-props": "off",
6767
"@eslint-react/no-unused-state": "warn",
6868
"@eslint-react/no-use-context": "warn",
6969
"@eslint-react/no-useless-forward-ref": "warn",
7070
"@eslint-react/no-useless-fragment": "warn",
7171
"@eslint-react/prefer-destructuring-assignment": "warn",
7272
"@eslint-react/prefer-namespace-import": "warn",
73-
// "@eslint-react/prefer-read-only-props": "error",
73+
"@eslint-react/prefer-read-only-props": "off",
7474
"@eslint-react/prefer-use-state-lazy-initialization": "warn",
7575

76-
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
77-
"@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": "warn",
78-
7976
"@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
8077
"@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
8178
"@eslint-react/dom/no-find-dom-node": "error",
@@ -87,21 +84,25 @@ export const rules = {
8784
"@eslint-react/dom/no-render": "error",
8885
"@eslint-react/dom/no-render-return-value": "error",
8986
"@eslint-react/dom/no-script-url": "warn",
87+
"@eslint-react/dom/no-string-style-prop": "error",
9088
"@eslint-react/dom/no-unknown-property": "warn",
9189
"@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
9290
"@eslint-react/dom/no-unsafe-target-blank": "warn",
93-
"@eslint-react/dom/no-use-form-state": "error",
91+
"@eslint-react/dom/no-use-form-state": "warn",
9492
"@eslint-react/dom/no-void-elements-with-children": "error",
93+
"@eslint-react/dom/prefer-namespace-import": "warn",
9594

9695
"@eslint-react/web-api/no-leaked-event-listener": "warn",
9796
"@eslint-react/web-api/no-leaked-interval": "warn",
9897
"@eslint-react/web-api/no-leaked-resize-observer": "warn",
9998
"@eslint-react/web-api/no-leaked-timeout": "warn",
10099

100+
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
101+
101102
"@eslint-react/naming-convention/component-name": "warn",
102103
"@eslint-react/naming-convention/context-name": "warn",
103-
"@eslint-react/naming-convention/filename": "warn",
104-
"@eslint-react/naming-convention/filename-extension": "warn",
104+
"@eslint-react/naming-convention/filename": "off",
105+
"@eslint-react/naming-convention/filename-extension": "off",
105106
"@eslint-react/naming-convention/use-state": "warn",
106107
} as const satisfies Record<string, RuleConfig>;
107108

packages/plugins/eslint-plugin/src/configs/recommended-type-checked.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const rules = {
88
...recommendedTypeScript.rules,
99
"@eslint-react/no-leaked-conditional-rendering": "warn",
1010
"@eslint-react/no-unused-props": "warn",
11-
// "@eslint-react/prefer-read-only-props": "warn",
1211
} as const satisfies Record<string, RuleConfig>;
1312

1413
export const plugins = {

packages/plugins/eslint-plugin/src/configs/x.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@ export const name = "@eslint-react/x";
77
export const rules = {
88
"@eslint-react/jsx-no-comment-textnodes": "warn",
99
"@eslint-react/jsx-no-duplicate-props": "warn",
10-
// "@eslint-react/jsx-no-iife": "warn",
11-
// "@eslint-react/jsx-no-undef": "error",
12-
// "@eslint-react/jsx-shorthand-boolean": "warn",
13-
// "@eslint-react/jsx-shorthand-fragment": "warn",
10+
"@eslint-react/jsx-no-iife": "off",
11+
"@eslint-react/jsx-no-undef": "off",
12+
"@eslint-react/jsx-shorthand-boolean": "off",
13+
"@eslint-react/jsx-shorthand-fragment": "off",
1414
"@eslint-react/jsx-uses-react": "warn",
1515
"@eslint-react/jsx-uses-vars": "warn",
16-
1716
"@eslint-react/no-access-state-in-setstate": "error",
1817
"@eslint-react/no-array-index-key": "warn",
1918
"@eslint-react/no-children-count": "warn",
2019
"@eslint-react/no-children-for-each": "warn",
2120
"@eslint-react/no-children-map": "warn",
2221
"@eslint-react/no-children-only": "warn",
23-
// "@eslint-react/no-children-prop": "warn",
22+
"@eslint-react/no-children-prop": "off",
2423
"@eslint-react/no-children-to-array": "warn",
25-
// "@eslint-react/no-class-component": "warn",
24+
"@eslint-react/no-class-component": "off",
2625
"@eslint-react/no-clone-element": "warn",
2726
"@eslint-react/no-component-will-mount": "error",
2827
"@eslint-react/no-component-will-receive-props": "error",
@@ -32,13 +31,14 @@ export const rules = {
3231
"@eslint-react/no-default-props": "error",
3332
"@eslint-react/no-direct-mutation-state": "error",
3433
"@eslint-react/no-duplicate-key": "error",
34+
"@eslint-react/no-forbidden-props": "off",
3535
"@eslint-react/no-forward-ref": "warn",
3636
"@eslint-react/no-implicit-key": "warn",
37-
// "@eslint-react/no-leaked-conditional-rendering": "warn",
38-
// "@eslint-react/no-missing-component-display-name": "warn",
39-
// "@eslint-react/no-missing-context-display-name": "warn",
37+
"@eslint-react/no-leaked-conditional-rendering": "off",
38+
"@eslint-react/no-missing-component-display-name": "off",
39+
"@eslint-react/no-missing-context-display-name": "off",
4040
"@eslint-react/no-missing-key": "error",
41-
// "@eslint-react/no-misused-capture-owner-stack": "error",
41+
"@eslint-react/no-misused-capture-owner-stack": "off",
4242
"@eslint-react/no-nested-component-definitions": "error",
4343
"@eslint-react/no-nested-lazy-component-declarations": "error",
4444
"@eslint-react/no-prop-types": "error",
@@ -47,23 +47,24 @@ export const rules = {
4747
"@eslint-react/no-set-state-in-component-did-update": "warn",
4848
"@eslint-react/no-set-state-in-component-will-update": "warn",
4949
"@eslint-react/no-string-refs": "error",
50-
// "@eslint-react/no-unnecessary-use-callback": "warn",
51-
// "@eslint-react/no-unnecessary-use-memo": "warn",
50+
"@eslint-react/no-unnecessary-key": "off",
51+
"@eslint-react/no-unnecessary-use-callback": "off",
52+
"@eslint-react/no-unnecessary-use-memo": "off",
5253
"@eslint-react/no-unnecessary-use-prefix": "warn",
5354
"@eslint-react/no-unsafe-component-will-mount": "warn",
5455
"@eslint-react/no-unsafe-component-will-receive-props": "warn",
5556
"@eslint-react/no-unsafe-component-will-update": "warn",
5657
"@eslint-react/no-unstable-context-value": "warn",
5758
"@eslint-react/no-unstable-default-props": "warn",
5859
"@eslint-react/no-unused-class-component-members": "warn",
59-
// "@eslint-react/no-unused-props": "warn",
60+
"@eslint-react/no-unused-props": "off",
6061
"@eslint-react/no-unused-state": "warn",
6162
"@eslint-react/no-use-context": "warn",
6263
"@eslint-react/no-useless-forward-ref": "warn",
63-
// "@eslint-react/no-useless-fragment": "warn",
64-
// "@eslint-react/prefer-destructuring-assignment": "warn",
65-
// "@eslint-react/prefer-namespace-import": "warn",
66-
// "@eslint-react/prefer-read-only-props": "error",
64+
"@eslint-react/no-useless-fragment": "off",
65+
"@eslint-react/prefer-destructuring-assignment": "off",
66+
"@eslint-react/prefer-namespace-import": "off",
67+
"@eslint-react/prefer-read-only-props": "off",
6768
"@eslint-react/prefer-use-state-lazy-initialization": "warn",
6869
} as const satisfies Record<string, RuleConfig>;
6970

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)