Skip to content

Commit 01b1559

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 7f493e3 + 06c6908 commit 01b1559

3 files changed

Lines changed: 96 additions & 53 deletions

File tree

.eslintignore

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

.eslintrc-jsdoc.js

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,60 @@
1-
module.exports = {
2-
rules: {
3-
'require-jsdoc': 'off',
4-
'valid-jsdoc': [ 'error', {
5-
prefer: {
6-
arg: 'param',
7-
argument: 'param',
8-
extends: 'augments',
9-
returns: 'return',
1+
/**
2+
* ESLint v10 flat config file for JSDoc linting.
3+
* This config is based on the original valid-jsdoc rules.
4+
*/
5+
6+
const jsdocPlugin = require( 'eslint-plugin-jsdoc' );
7+
8+
module.exports = [
9+
{
10+
plugins: {
11+
jsdoc: jsdocPlugin,
12+
},
13+
settings: {
14+
jsdoc: {
15+
tagNamePreference: {
16+
'arg': 'param',
17+
'argument': 'param',
18+
'extends': 'augments',
19+
'returns': 'return',
20+
},
21+
preferredTypes: {
22+
'array': 'Array',
23+
'bool': 'boolean',
24+
'Boolean': 'boolean',
25+
'float': 'number',
26+
'Float': 'number',
27+
'function': 'Function',
28+
'int': 'number',
29+
'integer': 'number',
30+
'Integer': 'number',
31+
'Number': 'number',
32+
'object': 'Object',
33+
'String': 'string',
34+
'Void': 'void',
35+
},
1036
},
11-
preferType: {
12-
array: 'Array',
13-
bool: 'boolean',
14-
Boolean: 'boolean',
15-
float: 'number',
16-
Float: 'number',
17-
int: 'number',
18-
integer: 'number',
19-
Integer: 'number',
20-
Number: 'number',
21-
object: 'Object',
22-
String: 'string',
23-
Void: 'void',
24-
},
25-
requireParamDescription: false,
26-
requireReturn: false,
27-
} ],
37+
},
38+
rules: {
39+
'jsdoc/check-param-names': 'error',
40+
'jsdoc/check-types': 'error',
41+
'jsdoc/check-tag-names': [ 'error', {
42+
definedTags: [
43+
'memberOf',
44+
'output',
45+
'ticket',
46+
'link',
47+
],
48+
} ],
49+
'jsdoc/require-param': [ 'error', {
50+
enableFixer: false,
51+
} ],
52+
'jsdoc/require-param-type': 'error',
53+
'jsdoc/require-returns-check': 'error',
54+
'jsdoc/require-returns-description': 'error',
55+
'jsdoc/require-returns': 'error',
56+
'jsdoc/require-returns-type': 'error',
57+
'jsdoc/check-syntax': 'error',
58+
},
2859
},
29-
};
60+
];

eslint.config.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* ESLint v10 flat config entry point.
3+
*
4+
* This minimal config focuses only on JSDoc linting by importing
5+
* the configuration from .eslintrc-jsdoc.js.
6+
*
7+
* General JavaScript linting is not performed here.
8+
*/
9+
10+
const jsdocConfig = require( './.eslintrc-jsdoc.js' );
11+
12+
module.exports = [
13+
...jsdocConfig,
14+
{
15+
ignores: [
16+
'build/**',
17+
'**/build/**',
18+
'node_modules/**',
19+
'tests/**',
20+
'vendor/**',
21+
'tools/**',
22+
'jsdoc/**',
23+
'artifacts/**',
24+
'coverage/**',
25+
'.cache/**',
26+
'src/wp-includes/blocks/**/*.js',
27+
'src/wp-includes/blocks/**/*.js.map',
28+
'src/wp-content/themes/**',
29+
'src/wp-content/plugins/**',
30+
'src/wp-content/mu-plugins/**',
31+
'src/wp-content/upgrade/**',
32+
'src/wp-content/uploads/**',
33+
'src/js/_enqueues/vendor/**',
34+
'src/wp-admin/js/**',
35+
'src/wp-includes/js/**',
36+
],
37+
},
38+
];

0 commit comments

Comments
 (0)