-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy path.eslintrc.js
More file actions
72 lines (72 loc) · 1.93 KB
/
.eslintrc.js
File metadata and controls
72 lines (72 loc) · 1.93 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
62
63
64
65
66
67
68
69
70
71
72
module.exports = {
root: true,
extends: ['plugin:@wordpress/eslint-plugin/recommended-with-formatting'],
env: {
browser: true,
jquery: true,
},
globals: {
// WordPress globals
wp: 'readonly',
ajaxurl: 'readonly',
pagenow: 'readonly',
typenow: 'readonly',
adminpage: 'readonly',
// Vue.js
Vue: 'readonly',
// Ultimate Multisite globals
wu_moment: 'readonly',
wu_activity_stream_nonce: 'readonly',
wu_checkout: 'readonly',
wu_checkout_form: 'readonly',
wu_block_ui: 'readonly',
wu_block_ui_legacy: 'readonly',
wu_format_money: 'readonly',
wu_template_previewer: 'readonly',
wu_fields: 'readonly',
wu_settings: 'readonly',
wu_addons: 'readonly',
wubox: 'readonly',
Swal: 'readonly',
ClipboardJS: 'readonly',
Shepherd: 'readonly',
ApexCharts: 'readonly',
tippy: 'readonly',
},
rules: {
// Allow tabs for indentation (matches PHP coding standards)
indent: ['error', 'tab', { SwitchCase: 1 }],
// Disable prettier - too strict for legacy code
'prettier/prettier': 'off',
// Relax some rules for legacy code compatibility
'no-unused-vars': ['warn', { vars: 'all', args: 'none', ignoreRestSiblings: true }],
// Allow console for development
'no-console': 'warn',
// Allow var for legacy code
'no-var': 'warn',
// Prefer const but don't enforce strictly for legacy code
'prefer-const': 'warn',
// Object shorthand is nice but not required for legacy code
'object-shorthand': 'warn',
// Allow snake_case for WP compatibility
camelcase: 'off',
// Allow redeclaring globals (we define them above)
'no-redeclare': 'off',
// Disable strict formatting rules for legacy code
'space-in-parens': 'off',
'comma-dangle': 'off',
quotes: 'off',
semi: 'off',
'padded-blocks': 'off',
'eol-last': 'off',
'space-before-function-paren': 'off',
'space-before-blocks': 'off',
},
ignorePatterns: [
'**/*.min.js',
'node_modules/',
'vendor/',
'lib/',
'assets/js/lib/',
],
};