@eslint-react/eslint-plugin 2.0.0-next.8 → 2.0.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Version](https://img.shields.io/npm/v/@eslint-react/eslint-plugin?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/@eslint-react/eslint-plugin)
6
6
  [![Downloads](https://img.shields.io/npm/dt/@eslint-react/eslint-plugin.svg?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/@eslint-react/eslint-plugin)
7
7
 
8
- A series of composable ESLint rules for React and friends.
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, React 19, and more.
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 tseslint.config({
76
- files: ["**/*.ts", "**/*.tsx"],
77
-
78
- // Extend recommended rule sets from:
79
- // 1. ESLint JS's recommended rules
80
- // 2. TypeScript ESLint recommended rules
81
- // 3. ESLint React's recommended-typescript rules
82
- extends: [
83
- eslintJs.configs.recommended,
84
- tseslint.configs.recommended,
85
- eslintReact.configs["recommended-typescript"],
86
- ],
87
-
88
- // Configure language/parsing options
89
- languageOptions: {
90
- // Use TypeScript ESLint parser for TypeScript files
91
- parser: tseslint.parser,
92
- parserOptions: {
93
- // Enable project service for better TypeScript integration
94
- projectService: true,
95
- tsconfigRootDir: import.meta.dirname,
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
- // Custom rule overrides (modify rule levels or disable rules)
100
- rules: {
101
- "@eslint-react/no-missing-key": "warn",
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
@@ -140,6 +142,8 @@ export default tseslint.config({
140
142
  Disable rules in the `web-api` preset.
141
143
  - `disable-type-checked`\
142
144
  Disable rules that require type information.
145
+ - `disable-conflict-eslint-plugin-react`\
146
+ Disable rules in `eslint-plugin-react` that conflict with rules in our plugins.
143
147
  - `off`\
144
148
  Disable all rules in this plugin except for debug rules.
145
149
 
@@ -149,6 +153,10 @@ export default tseslint.config({
149
153
 
150
154
  [Rules Overview ↗](https://eslint-react.xyz/docs/rules/overview)
151
155
 
156
+ ## Benchmark
157
+
158
+ [Benchmark Results ↗](https://github.com/Rel1cx/eslint-react-benchmark)
159
+
152
160
  ## FAQ
153
161
 
154
162
  [Frequently Asked Questions ↗](https://eslint-react.xyz/docs/faq)
@@ -161,8 +169,8 @@ export default tseslint.config({
161
169
 
162
170
  Contributions are welcome!
163
171
 
164
- Please follow our [contributing guidelines](./.github/CONTRIBUTING.md).
172
+ Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/main/.github/CONTRIBUTING.md).
165
173
 
166
174
  ## License
167
175
 
168
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
176
+ This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/main/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 };