-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
112 lines (111 loc) · 2.96 KB
/
eslint.config.js
File metadata and controls
112 lines (111 loc) · 2.96 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import globals from 'globals';
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import jsdocPlugin from 'eslint-plugin-jsdoc';
export default [
// Global ignores (replaces .eslintignore)
{
ignores: ['js/**/*', 'node_modules/**/*']
},
// ESLint recommended rules
js.configs.recommended,
// Prettier config to disable conflicting rules
prettier,
// Main configuration
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
// Drupal core globals (matching Drupal 11)
Backbone: 'readonly',
CKEDITOR: 'readonly',
CKEditor5: 'readonly',
Cookies: 'readonly',
Drupal: 'readonly',
drupalSettings: 'readonly',
drupalTranslations: 'readonly',
domready: 'readonly',
jQuery: 'readonly',
_: 'readonly',
matchMedia: 'readonly',
Modernizr: 'readonly',
once: 'readonly',
htmx: 'readonly',
loadjs: 'readonly',
Shepherd: 'readonly',
Sortable: 'readonly',
tabbable: 'readonly',
transliterate: 'readonly',
bodyScrollLock: 'readonly',
FloatingUIDOM: 'readonly'
}
},
plugins: {
import: importPlugin,
jsdoc: jsdocPlugin
},
settings: {
jsdoc: {
tagNamePreference: {
returns: 'return',
property: 'prop'
}
}
},
rules: {
// Custom rules matching Drupal 11 core
'consistent-return': 'off',
'no-underscore-dangle': 'off',
'max-nested-callbacks': ['warn', 3],
'import/no-mutable-exports': 'warn',
'no-plusplus': [
'warn',
{
allowForLoopAfterthoughts: true
}
],
'no-param-reassign': 'off',
'no-prototype-builtins': 'off',
'no-unused-vars': 'warn',
'operator-linebreak': [
'error',
'after',
{ overrides: { '?': 'ignore', ':': 'ignore' } }
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false
}
],
'no-multi-spaces': [
'error',
{
exceptions: {
ImportDeclaration: true,
VariableDeclarator: true,
Property: true
}
}
],
// JSDoc rules (matching Drupal 11 core)
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-type': 'warn',
'jsdoc/require-returns-description': 'warn',
'jsdoc/require-returns-check': 'warn',
'jsdoc/require-param': 'warn',
'jsdoc/require-param-type': 'warn',
'jsdoc/require-param-description': 'warn',
'jsdoc/check-param-names': 'warn',
'jsdoc/valid-types': 'warn',
'jsdoc/require-param-name': 'warn',
'jsdoc/check-tag-names': 'warn'
}
}
];