@eslint-react/eslint-plugin 2.0.0-next.19 → 2.0.0-next.190
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 +43 -37
- package/dist/chunk-CTAAG5j7.js +13 -0
- package/dist/index.d.ts +1092 -3011
- package/dist/index.js +445 -398
- package/package.json +18 -26
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://npmjs.com/package/@eslint-react/eslint-plugin)
|
|
6
6
|
[](https://npmjs.com/package/@eslint-react/eslint-plugin)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
4-7x faster composable ESLint rules for React and friends.
|
|
9
9
|
|
|
10
10
|
## Table of Contents
|
|
11
11
|
|
|
@@ -22,6 +22,7 @@ A series of composable ESLint rules for React and friends.
|
|
|
22
22
|
- [TypeScript Specialized](#typescript-specialized)
|
|
23
23
|
- [Other](#other)
|
|
24
24
|
- [Rules](#rules)
|
|
25
|
+
- [Benchmark](#benchmark)
|
|
25
26
|
- [FAQ](#faq)
|
|
26
27
|
- [Roadmap](#roadmap)
|
|
27
28
|
- [Contributing](#contributing)
|
|
@@ -29,10 +30,10 @@ A series of composable ESLint rules for React and friends.
|
|
|
29
30
|
|
|
30
31
|
## Features
|
|
31
32
|
|
|
32
|
-
- **Modern**: First-class support for TypeScript
|
|
33
|
-
- **Flexible**: Fully customizable rule severity levels, allowing you to enforce or relax rules as needed.
|
|
34
|
-
- **Performant**: Built with performance in mind, optimized for large codebases.
|
|
35
|
-
- **Context-aware Linting**: Rules that understand the context of your code and project configuration to provide more accurate linting.
|
|
33
|
+
- **Modern**: First-class support for **TypeScript**, **React 19**, and more.
|
|
34
|
+
- **Flexible**: Fully customizable rule severity levels, allowing you to **enforce** or **relax** rules as needed.
|
|
35
|
+
- **Performant**: Built with performance in mind, optimized for large codebases, [**4-7x faster**](https://github.com/Rel1cx/eslint-react-benchmark) than other ESLint plugins.
|
|
36
|
+
- **Context-aware Linting**: Rules that understand the context of your code and [project configuration](https://eslint-react.xyz/docs/configuration/configure-project-config) to provide more **accurate** linting.
|
|
36
37
|
|
|
37
38
|
## Public Packages
|
|
38
39
|
|
|
@@ -41,6 +42,7 @@ A series of composable ESLint rules for React and friends.
|
|
|
41
42
|
- [`eslint-plugin-react-x`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) - X Rules (renderer-agnostic, compatible with x-platform).
|
|
42
43
|
- [`eslint-plugin-react-dom`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) - DOM specific rules for React DOM.
|
|
43
44
|
- [`eslint-plugin-react-web-api`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api) - Rules for interacting with Web APIs.
|
|
45
|
+
- [`eslint-plugin-react-hooks-extra`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra) - Extra React Hooks rules.
|
|
44
46
|
- [`eslint-plugin-react-naming-convention`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) - Naming convention rules.
|
|
45
47
|
|
|
46
48
|
### Unified
|
|
@@ -67,46 +69,46 @@ npm install --save-dev typescript-eslint @eslint-react/eslint-plugin
|
|
|
67
69
|
```js
|
|
68
70
|
// eslint.config.js
|
|
69
71
|
|
|
70
|
-
// @ts-check
|
|
71
|
-
import eslintJs from "@eslint/js";
|
|
72
72
|
import eslintReact from "@eslint-react/eslint-plugin";
|
|
73
|
+
import eslintJs from "@eslint/js";
|
|
74
|
+
import { defineConfig } from "eslint/config";
|
|
73
75
|
import tseslint from "typescript-eslint";
|
|
74
76
|
|
|
75
|
-
export default
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
77
|
+
export default defineConfig([
|
|
78
|
+
{
|
|
79
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
80
|
+
|
|
81
|
+
// Extend recommended rule sets from:
|
|
82
|
+
// 1. ESLint JS's recommended rules
|
|
83
|
+
// 2. TypeScript ESLint recommended rules
|
|
84
|
+
// 3. ESLint React's recommended-typescript rules
|
|
85
|
+
extends: [
|
|
86
|
+
eslintJs.configs.recommended,
|
|
87
|
+
tseslint.configs.recommended,
|
|
88
|
+
eslintReact.configs["recommended-typescript"],
|
|
89
|
+
],
|
|
90
|
+
|
|
91
|
+
// Configure language/parsing options
|
|
92
|
+
languageOptions: {
|
|
93
|
+
// Use TypeScript ESLint parser for TypeScript files
|
|
94
|
+
parser: tseslint.parser,
|
|
95
|
+
parserOptions: {
|
|
96
|
+
// Enable project service for better TypeScript integration
|
|
97
|
+
projectService: true,
|
|
98
|
+
tsconfigRootDir: import.meta.dirname,
|
|
99
|
+
},
|
|
96
100
|
},
|
|
97
|
-
},
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
// Custom rule overrides (modify rule levels or disable rules)
|
|
103
|
+
rules: {
|
|
104
|
+
"@eslint-react/no-missing-key": "warn",
|
|
105
|
+
},
|
|
102
106
|
},
|
|
103
|
-
|
|
107
|
+
]);
|
|
104
108
|
```
|
|
105
109
|
|
|
106
110
|
[Full Installation Guide ↗](https://eslint-react.xyz/docs/getting-started/typescript)
|
|
107
111
|
|
|
108
|
-
</details>
|
|
109
|
-
|
|
110
112
|
## Presets
|
|
111
113
|
|
|
112
114
|
### Bare Bones
|
|
@@ -149,6 +151,10 @@ export default tseslint.config({
|
|
|
149
151
|
|
|
150
152
|
[Rules Overview ↗](https://eslint-react.xyz/docs/rules/overview)
|
|
151
153
|
|
|
154
|
+
## Benchmark
|
|
155
|
+
|
|
156
|
+
[Benchmark Results ↗](https://github.com/Rel1cx/eslint-react-benchmark)
|
|
157
|
+
|
|
152
158
|
## FAQ
|
|
153
159
|
|
|
154
160
|
[Frequently Asked Questions ↗](https://eslint-react.xyz/docs/faq)
|
|
@@ -161,8 +167,8 @@ export default tseslint.config({
|
|
|
161
167
|
|
|
162
168
|
Contributions are welcome!
|
|
163
169
|
|
|
164
|
-
Please follow our [contributing guidelines](
|
|
170
|
+
Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/2.0.0/.github/CONTRIBUTING.md).
|
|
165
171
|
|
|
166
172
|
## License
|
|
167
173
|
|
|
168
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
174
|
+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/2.0.0/LICENSE) file for details.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (all) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __export };
|