-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy patheslint.config.js
More file actions
61 lines (60 loc) · 1.7 KB
/
eslint.config.js
File metadata and controls
61 lines (60 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const AutomatticPlugin = require( '@automattic/eslint-plugin-wpvip' );
module.exports = [
{
ignores: [
'node_modules/**/*',
'**/dist/**/*',
'vendor/**/*',
'**/*.build.js',
],
},
...AutomatticPlugin.configs.recommended,
{
languageOptions: {
parserOptions: {
babelOptions: {
presets: [ '@babel/preset-react' ],
},
},
},
settings: {
react: {
version: 'detect',
},
// WordPress packages are loaded at runtime, not installed as npm dependencies
'import/core-modules': [ '@wordpress/i18n', '@wordpress/url', '@wordpress/data', '@wordpress/components', '@wordpress/compose', '@wordpress/plugins', '@wordpress/editor', 'moment', 'react', 'react-dom' ],
},
rules: {
// WordPress packages (react, react-dom, etc.) are available at runtime via wp-scripts
'import/no-extraneous-dependencies': 'off',
'no-duplicate-imports': 'off', // Conflicts with type-only imports pattern
// Project-specific rule overrides (matching previous .eslintrc.js)
'no-prototype-builtins': 'off',
'no-eval': 'off',
complexity: 'off',
camelcase: 'off',
'no-undef': 'off',
'valid-jsdoc': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'off',
'no-redeclare': 'off',
'no-shadow': 'off',
'no-nested-ternary': 'off',
'no-var': 'off',
'no-unused-vars': 'off',
'no-useless-escape': 'off',
'prefer-const': 'off',
'no-global-assign': 'off',
'no-constant-binary-expression': 'off',
'valid-typeof': 'off',
eqeqeq: 'off',
radix: 'off',
'no-eq-null': 'off',
'array-callback-return': 'off',
'no-unused-expressions': 'off',
'no-alert': 'off',
'no-lonely-if': 'off',
},
},
];