Skip to content

Commit 77786c5

Browse files
committed
Remove eslint-plugin-react
1 parent e4a4926 commit 77786c5

File tree

10 files changed

+34
-1313
lines changed

10 files changed

+34
-1313
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@
4545
"dependencies": {
4646
"@stylistic/eslint-plugin": "^5.10.0",
4747
"eslint-plugin-perfectionist": "^5.7.0",
48-
"eslint-plugin-react": "^7.37.5",
4948
"eslint-plugin-react-x": "^3.0.0"
5049
},
5150
"peerDependencies": {
5251
"@standard-config/oxlint": ">=1.3.0",
53-
"eslint": ">=10.1.0",
54-
"typescript-eslint": ">=8.57.0"
52+
"eslint": ">=10.0.0",
53+
"typescript-eslint": ">=8.56.0"
5554
},
5655
"peerDependenciesMeta": {
5756
"@standard-config/oxlint": {

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ onlyBuiltDependencies:
55

66
peerDependencyRules:
77
allowAny:
8-
- eslint
98
- typescript
109
- vitest
1110

src/config-react/__snapshots__/eslint.test.ts.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ exports[`is a valid ESLint config 1`] = `
55
"name": "React",
66
"plugins": {
77
"perfectionist": [ESLint.Plugin],
8-
"react": [ESLint.Plugin],
98
"react-x": [ESLint.Plugin],
109
},
1110
"rules": {
@@ -79,17 +78,6 @@ exports[`is a valid ESLint config 1`] = `
7978
"react-x/unsupported-syntax": "error",
8079
"react-x/use-memo": "error",
8180
"react-x/use-state": "error",
82-
"react/function-component-definition": [
83-
"error",
84-
{
85-
"namedComponents": [
86-
"arrow-function",
87-
"function-declaration",
88-
],
89-
"unnamedComponents": "arrow-function",
90-
},
91-
],
92-
"react/no-adjacent-inline-elements": "error",
9381
},
9482
"settings": {
9583
"react": {

src/config-react/__snapshots__/oxlint.test.ts.snap

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ exports[`is a valid Oxlint config 1`] = `
1111
"name": "perfectionist",
1212
"specifier": "eslint-plugin-perfectionist",
1313
},
14-
{
15-
"name": "react-js",
16-
"specifier": "eslint-plugin-react",
17-
},
1814
{
1915
"name": "react-x",
2016
"specifier": "eslint-plugin-react-x",
@@ -132,17 +128,6 @@ exports[`is a valid Oxlint config 1`] = `
132128
"type": "unsorted",
133129
},
134130
],
135-
"react-js/function-component-definition": [
136-
"error",
137-
{
138-
"namedComponents": [
139-
"arrow-function",
140-
"function-declaration",
141-
],
142-
"unnamedComponents": "arrow-function",
143-
},
144-
],
145-
"react-js/no-adjacent-inline-elements": "error",
146131
"react-x/component-hook-factories": "error",
147132
"react-x/error-boundaries": "error",
148133
"react-x/immutability": "error",

src/config-react/eslint.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type { LinterConfigEntry } from '../types/eslint.d.ts';
22
import pluginPerfectionist from 'eslint-plugin-perfectionist';
3-
import pluginReact from 'eslint-plugin-react';
4-
import pluginReactX from 'eslint-plugin-react-x';
3+
import pluginReact from 'eslint-plugin-react-x';
54
import rulesPerfectionist from './rules-perfectionist.ts';
6-
import rulesReactX from './rules-react-x.ts';
75
import rulesReact from './rules-react.ts';
86

97
/**
@@ -17,8 +15,7 @@ const config: LinterConfigEntry = {
1715
name: 'React',
1816
plugins: {
1917
'perfectionist': pluginPerfectionist,
20-
'react': pluginReact,
21-
'react-x': pluginReactX,
18+
'react-x': pluginReact,
2219
},
2320
settings: {
2421
react: {
@@ -28,7 +25,7 @@ const config: LinterConfigEntry = {
2825
rules: {
2926
...rulesPerfectionist,
3027
...rulesReact,
31-
...rulesReactX,
28+
...rulesReact,
3229
},
3330
};
3431

src/config-react/oxlint.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import oxlintConfigBase from '../config-base/oxlint.ts';
44
import transformPlugin from '../utilities/transform-plugin/index.ts';
55
import transformRules from '../utilities/transform-rules/index.ts';
66
import rulesPerfectionist from './rules-perfectionist.ts';
7-
import rulesReactX from './rules-react-x.ts';
87
import rulesReact from './rules-react.ts';
98

109
/**
@@ -23,19 +22,13 @@ const config: OxlintConfig = {
2322
},
2423
};
2524

26-
config.jsPlugins!.push(
27-
transformPlugin('react-js', 'eslint-plugin-react'),
28-
transformPlugin('react-x', 'eslint-plugin-react-x')
29-
);
25+
config.jsPlugins!.push(transformPlugin('react-x', 'eslint-plugin-react-x'));
3026

3127
config.overrides!.push({
3228
files: ['**/*.tsx'],
3329
rules: {
3430
...rulesPerfectionist,
3531
...transformRules(rulesReact, {
36-
prefix: 'react-js',
37-
}),
38-
...transformRules(rulesReactX, {
3932
omit: [
4033
// Oxlint doesn’t support type-aware rules
4134
'react-x/no-implicit-key',

src/config-react/rules-react-x.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/config-react/rules-react.ts

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
import type { LinterConfigRules } from '../types/eslint.d.ts';
22

33
const rules: LinterConfigRules = {
4-
'react/function-component-definition': [
5-
'error',
6-
{
7-
namedComponents: ['arrow-function', 'function-declaration'],
8-
unnamedComponents: 'arrow-function',
9-
},
10-
],
11-
'react/no-adjacent-inline-elements': 'error',
4+
'react-x/component-hook-factories': 'error',
5+
'react-x/error-boundaries': 'error',
6+
'react-x/immutability': 'error',
7+
'react-x/jsx-dollar': 'error',
8+
'react-x/jsx-key-before-spread': 'error',
9+
'react-x/no-access-state-in-setstate': 'error',
10+
'react-x/no-class-component': 'error',
11+
'react-x/no-context-provider': 'error',
12+
'react-x/no-duplicate-key': 'error',
13+
'react-x/no-forward-ref': 'error',
14+
'react-x/no-implicit-key': 'error',
15+
'react-x/no-leaked-conditional-rendering': 'error',
16+
'react-x/no-misused-capture-owner-stack': 'error',
17+
'react-x/no-nested-component-definitions': 'error',
18+
'react-x/no-nested-lazy-component-declarations': 'error',
19+
'react-x/no-unnecessary-use-callback': 'error',
20+
'react-x/no-unnecessary-use-memo': 'error',
21+
'react-x/no-unstable-context-value': 'error',
22+
'react-x/no-unstable-default-props': 'error',
23+
'react-x/no-use-context': 'error',
24+
'react-x/prefer-destructuring-assignment': 'error',
25+
'react-x/purity': 'error',
26+
'react-x/refs': 'error',
27+
'react-x/set-state-in-effect': 'error',
28+
'react-x/set-state-in-render': 'error',
29+
'react-x/unsupported-syntax': 'error',
30+
'react-x/use-memo': 'error',
31+
'react-x/use-state': 'error',
1232
};
1333

1434
export default rules;

src/utilities/transform-plugin/index.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ vi.unmock('./index.ts');
77
const PLUGINS = [
88
'@stylistic/eslint-plugin',
99
'eslint-plugin-perfectionist',
10-
'eslint-plugin-react',
1110
'eslint-plugin-react-x',
1211
];
1312

0 commit comments

Comments
 (0)