eslint-plugin-react-x 2.9.3-next.0 โ 2.9.4-beta.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.
- package/README.md +1 -101
- package/dist/index.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# eslint-plugin-react-x
|
|
2
2
|
|
|
3
|
-
4-7x faster, composable ESLint rules for
|
|
3
|
+
4-7x faster, composable ESLint rules for libraries and frameworks that use React as a UI runtime.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -38,104 +38,4 @@ export default defineConfig(
|
|
|
38
38
|
|
|
39
39
|
## Rules
|
|
40
40
|
|
|
41
|
-
### JSX
|
|
42
|
-
|
|
43
|
-
- [`jsx-dollar`](https://eslint-react.xyz/docs/rules/jsx-dollar) - Prevents unnecessary `$` symbols before JSX expressions (๐ง Fixable)
|
|
44
|
-
- [`jsx-key-before-spread`](https://eslint-react.xyz/docs/rules/jsx-key-before-spread) - Enforces `key` prop placement before spread props (๐งช Experimental)
|
|
45
|
-
- [`jsx-no-comment-textnodes`](https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes) - Prevents comment strings (e.g., beginning with `//` or `/*`) from being accidentally inserted into a JSX element's text nodes
|
|
46
|
-
- [`jsx-no-duplicate-props`](https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props) - Disallows duplicate props in JSX elements
|
|
47
|
-
- [`jsx-no-iife`](https://eslint-react.xyz/docs/rules/jsx-no-iife) - Disallows immediately-invoked function expressions in JSX (๐งช Experimental)
|
|
48
|
-
- [`jsx-no-undef`](https://eslint-react.xyz/docs/rules/jsx-no-undef) - Prevents using variables in JSX that are not defined in the scope
|
|
49
|
-
- [`jsx-shorthand-boolean`](https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean) - Enforces shorthand syntax for boolean props (๐ง Fixable, โ๏ธ Configurable)
|
|
50
|
-
- [`jsx-shorthand-fragment`](https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment) - Enforces shorthand syntax for fragment elements (๐ง Fixable, โ๏ธ Configurable)
|
|
51
|
-
- [`jsx-uses-react`](https://eslint-react.xyz/docs/rules/jsx-uses-react) - Marks React variables as used when JSX is present
|
|
52
|
-
- [`jsx-uses-vars`](https://eslint-react.xyz/docs/rules/jsx-uses-vars) - Marks JSX element variables as used
|
|
53
|
-
|
|
54
|
-
### Key
|
|
55
|
-
|
|
56
|
-
- [`no-array-index-key`](https://eslint-react.xyz/docs/rules/no-array-index-key) - Disallows using an item's index in the array as its key
|
|
57
|
-
- [`no-create-ref`](https://eslint-react.xyz/docs/rules/no-create-ref) - Disallows `createRef` in function components
|
|
58
|
-
- [`no-duplicate-key`](https://eslint-react.xyz/docs/rules/no-duplicate-key) - Prevents duplicate `key` props on sibling elements when rendering lists
|
|
59
|
-
- [`no-implicit-key`](https://eslint-react.xyz/docs/rules/no-implicit-key) - Prevents `key` from not being explicitly specified (e.g., spreading `key` from objects) (๐งช Experimental)
|
|
60
|
-
- [`no-missing-key`](https://eslint-react.xyz/docs/rules/no-missing-key) - Disallows missing `key` on items in list rendering
|
|
61
|
-
- [`no-unnecessary-key`](https://eslint-react.xyz/docs/rules/no-unnecessary-key) - Disallows unnecessary `key` props on nested child elements when rendering lists (๐งช Experimental)
|
|
62
|
-
|
|
63
|
-
### Ref
|
|
64
|
-
|
|
65
|
-
- [`no-create-ref`](https://eslint-react.xyz/docs/rules/no-create-ref) - Disallows `createRef` in function components
|
|
66
|
-
- [`no-forward-ref`](https://eslint-react.xyz/docs/rules/no-forward-ref) - Replaces usage of `forwardRef` with passing `ref` as a prop (๐ Codemod, `React` >=19.0.0)
|
|
67
|
-
- [`no-unnecessary-use-ref`](https://eslint-react.xyz/docs/rules/no-unnecessary-use-ref) - Disallows unnecessary usage of `useRef` (๐งช Experimental)
|
|
68
|
-
- [`no-useless-forward-ref`](https://eslint-react.xyz/docs/rules/no-useless-forward-ref) - Disallows useless `forwardRef` calls on components that don't use `ref`s
|
|
69
|
-
|
|
70
|
-
### Props
|
|
71
|
-
|
|
72
|
-
- [`no-children-prop`](https://eslint-react.xyz/docs/rules/no-children-prop) - Disallows passing `children` as a prop
|
|
73
|
-
- [`no-unstable-default-props`](https://eslint-react.xyz/docs/rules/no-unstable-default-props) - Prevents using referential-type values as default props in object destructuring (โ๏ธ Configurable)
|
|
74
|
-
- [`no-unused-props`](https://eslint-react.xyz/docs/rules/no-unused-props) - Warns about component props that are defined but never used (๐ญ Type Checking, ๐งช Experimental)
|
|
75
|
-
- [`prefer-destructuring-assignment`](https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment) - Enforces destructuring assignment for component props and context
|
|
76
|
-
- [`prefer-read-only-props`](https://eslint-react.xyz/docs/rules/prefer-read-only-props) - Enforces read-only props in components (๐ญ Type Checking, ๐งช Experimental)
|
|
77
|
-
|
|
78
|
-
### Context
|
|
79
|
-
|
|
80
|
-
- [`no-context-provider`](https://eslint-react.xyz/docs/rules/no-context-provider) - Replaces usage of `<Context.Provider>` with `<Context>` (๐ Codemod, `React` >=19.0.0)
|
|
81
|
-
- [`no-unstable-context-value`](https://eslint-react.xyz/docs/rules/no-unstable-context-value) - Prevents non-stable values (i.e., object literals) from being used as a value for `Context.Provider`
|
|
82
|
-
- [`no-use-context`](https://eslint-react.xyz/docs/rules/no-use-context) - Replaces usage of `useContext` with `use` (๐ Codemod, `React` >=19.0.0)
|
|
83
|
-
- [`prefer-destructuring-assignment`](https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment) - Enforces destructuring assignment for component props and context
|
|
84
|
-
|
|
85
|
-
### Structure
|
|
86
|
-
|
|
87
|
-
- [`no-nested-component-definitions`](https://eslint-react.xyz/docs/rules/no-nested-component-definitions) - Disallows nesting component definitions inside other components
|
|
88
|
-
- [`no-nested-lazy-component-declarations`](https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations) - Disallows nesting lazy component declarations inside other components
|
|
89
|
-
|
|
90
|
-
### Rendering
|
|
91
|
-
|
|
92
|
-
- [`no-leaked-conditional-rendering`](https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering) - Prevents problematic leaked values from being rendered
|
|
93
|
-
|
|
94
|
-
### Optimization
|
|
95
|
-
|
|
96
|
-
- [`no-unnecessary-use-callback`](https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback) - Disallows unnecessary usage of `useCallback` (๐งช Experimental)
|
|
97
|
-
- [`no-unnecessary-use-memo`](https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo) - Disallows unnecessary usage of `useMemo` (๐งช Experimental)
|
|
98
|
-
- [`no-unstable-context-value`](https://eslint-react.xyz/docs/rules/no-unstable-context-value) - Prevents non-stable values (i.e., object literals) from being used as a value for `Context.Provider`
|
|
99
|
-
- [`no-unstable-default-props`](https://eslint-react.xyz/docs/rules/no-unstable-default-props) - Prevents using referential-type values as default props in object destructuring (โ๏ธ Configurable)
|
|
100
|
-
- [`prefer-use-state-lazy-initialization`](https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization) - Enforces wrapping function calls made inside `useState` in an `initializer function`
|
|
101
|
-
|
|
102
|
-
### Legacy Element APIs
|
|
103
|
-
|
|
104
|
-
- [`no-clone-element`](https://eslint-react.xyz/docs/rules/no-clone-element) - Disallows `cloneElement`
|
|
105
|
-
|
|
106
|
-
### Legacy Children APIs
|
|
107
|
-
|
|
108
|
-
- [`no-children-count`](https://eslint-react.xyz/docs/rules/no-children-count) - Disallows the use of `Children.count` from the `react` package
|
|
109
|
-
- [`no-children-for-each`](https://eslint-react.xyz/docs/rules/no-children-for-each) - Disallows the use of `Children.forEach` from the `react` package
|
|
110
|
-
- [`no-children-map`](https://eslint-react.xyz/docs/rules/no-children-map) - Disallows the use of `Children.map` from the `react` package
|
|
111
|
-
- [`no-children-only`](https://eslint-react.xyz/docs/rules/no-children-only) - Disallows the use of `Children.only` from the `react` package
|
|
112
|
-
- [`no-children-to-array`](https://eslint-react.xyz/docs/rules/no-children-to-array) - Disallows the use of `Children.toArray` from the `react` package
|
|
113
|
-
|
|
114
|
-
### Legacy Component APIs
|
|
115
|
-
|
|
116
|
-
- [`no-access-state-in-setstate`](https://eslint-react.xyz/docs/rules/no-access-state-in-setstate) - Disallows accessing `this.state` inside `setState` calls
|
|
117
|
-
- [`no-class-component`](https://eslint-react.xyz/docs/rules/no-class-component) - Disallows class components except for error boundaries
|
|
118
|
-
- [`no-component-will-mount`](https://eslint-react.xyz/docs/rules/no-component-will-mount) - Replaces usage of `componentWillMount` with `UNSAFE_componentWillMount` (๐ Codemod, `React` >=16.3.0)
|
|
119
|
-
- [`no-component-will-receive-props`](https://eslint-react.xyz/docs/rules/no-component-will-receive-props) - Replaces usage of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps` (๐ Codemod)
|
|
120
|
-
- [`no-component-will-update`](https://eslint-react.xyz/docs/rules/no-component-will-update) - Replaces usage of `componentWillUpdate` with `UNSAFE_componentWillUpdate` (๐ Codemod)
|
|
121
|
-
- [`no-direct-mutation-state`](https://eslint-react.xyz/docs/rules/no-direct-mutation-state) - Disallows direct mutation of `this.state`
|
|
122
|
-
- [`no-redundant-should-component-update`](https://eslint-react.xyz/docs/rules/no-redundant-should-component-update) - Disallows `shouldComponentUpdate` when extending `React.PureComponent`
|
|
123
|
-
- [`no-set-state-in-component-did-mount`](https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount) - Disallows calling `this.setState` in `componentDidMount` outside functions such as callbacks
|
|
124
|
-
- [`no-set-state-in-component-did-update`](https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update) - Disallows calling `this.setState` in `componentDidUpdate` outside functions such as callbacks
|
|
125
|
-
- [`no-set-state-in-component-will-update`](https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update) - Disallows calling `this.setState` in `componentWillUpdate` outside functions such as callbacks
|
|
126
|
-
- [`no-unsafe-component-will-mount`](https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount) - Warns about the use of `UNSAFE_componentWillMount` in class components
|
|
127
|
-
- [`no-unsafe-component-will-receive-props`](https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props) - Warns about the use of `UNSAFE_componentWillReceiveProps` in class components
|
|
128
|
-
- [`no-unsafe-component-will-update`](https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update) - Warns about the use of `UNSAFE_componentWillUpdate` in class components
|
|
129
|
-
- [`no-unused-class-component-members`](https://eslint-react.xyz/docs/rules/no-unused-class-component-members) - Warns about unused class component methods and properties
|
|
130
|
-
- [`no-unused-state`](https://eslint-react.xyz/docs/rules/no-unused-state) - Warns about unused class component state
|
|
131
|
-
|
|
132
|
-
### Miscellaneous
|
|
133
|
-
|
|
134
|
-
- [`no-missing-component-display-name`](https://eslint-react.xyz/docs/rules/no-missing-component-display-name) - Enforces that all components have a `displayName` that can be used in DevTools
|
|
135
|
-
- [`no-missing-context-display-name`](https://eslint-react.xyz/docs/rules/no-missing-context-display-name) - Enforces that all contexts have a `displayName` that can be used in DevTools (๐ง Fixable)
|
|
136
|
-
- [`no-misused-capture-owner-stack`](https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack) - Prevents incorrect usage of `captureOwnerStack` (๐งช Experimental)
|
|
137
|
-
- [`no-unnecessary-use-prefix`](https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix) - Enforces that a function with the `use` prefix uses at least one Hook inside it
|
|
138
|
-
- [`no-useless-fragment`](https://eslint-react.xyz/docs/rules/no-useless-fragment) - Disallows useless fragment elements (๐ง Fixable, โ๏ธ Configurable)
|
|
139
|
-
- [`prefer-namespace-import`](https://eslint-react.xyz/docs/rules/prefer-namespace-import) - Enforces importing React via a namespace import
|
|
140
|
-
|
|
141
41
|
<https://eslint-react.xyz/docs/rules/overview#x-rules>
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.9.
|
|
4
|
-
"description": "A set of composable ESLint rules for
|
|
3
|
+
"version": "2.9.4-beta.0",
|
|
4
|
+
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"eslint",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"is-immutable-type": "^5.0.1",
|
|
46
46
|
"ts-api-utils": "^2.4.0",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "2.9.
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/shared": "2.9.
|
|
51
|
-
"@eslint-react/var": "2.9.
|
|
52
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "2.9.4-beta.0",
|
|
49
|
+
"@eslint-react/eff": "2.9.4-beta.0",
|
|
50
|
+
"@eslint-react/shared": "2.9.4-beta.0",
|
|
51
|
+
"@eslint-react/var": "2.9.4-beta.0",
|
|
52
|
+
"@eslint-react/core": "2.9.4-beta.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.10",
|