@wordpress/eslint-plugin 25.0.0 → 25.0.1-next.v.202604201441.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 +16 -4
- package/package.json +5 -5
- package/rules/use-recommended-components.js +4 -0
package/README.md
CHANGED
|
@@ -14,7 +14,11 @@ npm install @wordpress/eslint-plugin --save-dev
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
**Minimum ESLint version:** `^9.0.0 || ^10.0.0`
|
|
18
|
+
|
|
19
|
+
> **Upgrading from an older version?** See the [ESLint v10 migration guide](https://github.com/WordPress/gutenberg/blob/HEAD/docs/how-to-guides/eslint-v10-migration.md) for a comprehensive walkthrough of the breaking changes, migration steps, and troubleshooting.
|
|
20
|
+
|
|
21
|
+
### Flat config (ESLint v9+, recommended)
|
|
18
22
|
|
|
19
23
|
Create an `eslint.config.mjs` file in your project root:
|
|
20
24
|
|
|
@@ -41,7 +45,7 @@ export default [
|
|
|
41
45
|
|
|
42
46
|
Refer to the [ESLint flat config documentation](https://eslint.org/docs/latest/use/configure/configuration-files) for more information.
|
|
43
47
|
|
|
44
|
-
### Legacy eslintrc (ESLint v9, deprecated)
|
|
48
|
+
### Legacy eslintrc (ESLint v9 only, deprecated)
|
|
45
49
|
|
|
46
50
|
If you are still using ESLint v9 with the legacy `.eslintrc.*` format, a compatibility wrapper is available:
|
|
47
51
|
|
|
@@ -52,7 +56,9 @@ const wordpress = require( '@wordpress/eslint-plugin/eslintrc' );
|
|
|
52
56
|
module.exports = wordpress.configs.recommended;
|
|
53
57
|
```
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
All config presets are available through the wrapper (e.g., `wordpress.configs.esnext`, `wordpress.configs[ 'recommended-with-formatting' ]`).
|
|
60
|
+
|
|
61
|
+
> **Note:** The eslintrc wrapper is deprecated and will be removed in the next major version. ESLint v10 does not support `.eslintrc.*` files at all. Please migrate to flat config.
|
|
56
62
|
|
|
57
63
|
### About the recommended preset
|
|
58
64
|
|
|
@@ -151,8 +157,14 @@ If you are upgrading from a previous version that used `.eslintrc.*` files:
|
|
|
151
157
|
3. Convert `overrides` to separate config objects with `files` patterns.
|
|
152
158
|
4. Replace `env` with `languageOptions.globals` using the [`globals`](https://www.npmjs.com/package/globals) package.
|
|
153
159
|
5. Delete your `.eslintignore` file and move patterns into an `ignores` config object.
|
|
160
|
+
6. Update rule prefixes in inline comments: `eslint-comments/*` has been renamed to `@eslint-community/eslint-comments/*`. For example:
|
|
161
|
+
```diff
|
|
162
|
+
- /* eslint-disable eslint-comments/no-unlimited-disable */
|
|
163
|
+
+ /* eslint-disable @eslint-community/eslint-comments/no-unlimited-disable */
|
|
164
|
+
```
|
|
165
|
+
7. Remove any `/* eslint-env */` comments — they are no longer supported in ESLint v10. Use `languageOptions.globals` in your config instead.
|
|
154
166
|
|
|
155
|
-
See the [ESLint migration guide](https://eslint.org/docs/latest/use/configure/migration-guide) for
|
|
167
|
+
For a comprehensive walkthrough with examples and troubleshooting, see the [Gutenberg ESLint v10 migration guide](https://github.com/WordPress/gutenberg/blob/HEAD/docs/how-to-guides/eslint-v10-migration.md). See also the [ESLint migration guide](https://eslint.org/docs/latest/use/configure/migration-guide) for general flat config details.
|
|
156
168
|
|
|
157
169
|
## Contributing to this package
|
|
158
170
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/eslint-plugin",
|
|
3
|
-
"version": "25.0.0",
|
|
3
|
+
"version": "25.0.1-next.v.202604201441.0+dab6d8c07",
|
|
4
4
|
"description": "ESLint plugin for WordPress development.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@babel/eslint-parser": "^7.28.6",
|
|
45
45
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
46
46
|
"@eslint/compat": "^2.0.0",
|
|
47
|
-
"@wordpress/babel-preset-default": "^8.44.0",
|
|
48
|
-
"@wordpress/prettier-config": "^4.44.0",
|
|
49
|
-
"@wordpress/theme": "^0.11.0",
|
|
47
|
+
"@wordpress/babel-preset-default": "^8.44.1-next.v.202604201441.0+dab6d8c07",
|
|
48
|
+
"@wordpress/prettier-config": "^4.44.1-next.v.202604201441.0+dab6d8c07",
|
|
49
|
+
"@wordpress/theme": "^0.11.1-next.v.202604201441.0+dab6d8c07",
|
|
50
50
|
"cosmiconfig": "^7.0.0",
|
|
51
51
|
"eslint-config-prettier": "^10.0.0",
|
|
52
52
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "c788005ba4ee2a34851c1217c51602656aa7c3a6"
|
|
87
87
|
}
|
|
@@ -24,6 +24,10 @@ const ALLOWLIST = {
|
|
|
24
24
|
*/
|
|
25
25
|
const DENYLIST = {
|
|
26
26
|
'@wordpress/components': {
|
|
27
|
+
__experimentalHeading: 'Use `Text` from `@wordpress/ui` instead.',
|
|
28
|
+
__experimentalHStack: 'Use `Stack` from `@wordpress/ui` instead.',
|
|
29
|
+
__experimentalText: 'Use `Text` from `@wordpress/ui` instead.',
|
|
30
|
+
__experimentalVStack: 'Use `Stack` from `@wordpress/ui` instead.',
|
|
27
31
|
__experimentalZStack:
|
|
28
32
|
'{{ name }} is planned for deprecation. Write your own CSS instead.',
|
|
29
33
|
},
|