-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy patheslint.config.mjs
More file actions
59 lines (58 loc) · 1.73 KB
/
Copy patheslint.config.mjs
File metadata and controls
59 lines (58 loc) · 1.73 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
/**
* ESLint flat config.
*
* Replaces both .jshintrc and .jscsrc — JSCS was deprecated years ago and told
* users to migrate to ESLint ("JSCS has merged with ESLint").
*
* Only theme-authored JavaScript is linted. The bundled third-party libraries
* (FlexSlider, OwlCarousel, parallax) are minified vendor code and are ignored.
*/
import js from '@eslint/js';
import globals from 'globals';
export default [
{
ignores: [
'node_modules/**',
'vendor/**',
'build/**',
'assets/js/**/*.min.js',
'assets/js/owl-carousel/**',
'assets/js/dev/**',
'inc/libraries/**',
],
},
js.configs.recommended,
{
files: ['assets/js/**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'script',
globals: {
...globals.browser,
jQuery: 'readonly',
wp: 'readonly',
Masonry: 'readonly',
WPUrls: 'readonly',
Vimeo: 'readonly',
// Localized by wp_localize_script() in functions.php / the companion plugin.
ShapelyAdminObject: 'readonly',
ShapelyBuilder: 'readonly',
shapelyWelcomeScreenObject: 'readonly',
shapelyWelcomeScreenCustomizerObject: 'readonly',
},
},
rules: {
// Carried over from the old .jshintrc so the house style is unchanged.
curly: 'error',
eqeqeq: ['error', 'allow-null'],
quotes: ['error', 'single', { avoidEscape: true }],
'no-caller': 'error',
'no-eval': 'error',
'no-implied-eval': 'error',
'no-irregular-whitespace': ['error', { skipStrings: true }],
'no-unused-vars': ['warn', { args: 'none' }],
// jQuery plugins are feature-detected before use; don't flag the guards.
'no-undef': 'error',
},
},
];