-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
88 lines (87 loc) · 3.14 KB
/
Copy patheslint.config.js
File metadata and controls
88 lines (87 loc) · 3.14 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
// eslint.config.js - OpenVox JavaScript Linting Configuration
import js from '@eslint/js';
export default [
js.configs.recommended,
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
window: 'readonly',
document: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
requestAnimationFrame: 'readonly',
cancelAnimationFrame: 'readonly',
localStorage: 'readonly',
fetch: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
FormData: 'readonly',
FileReader: 'readonly',
Audio: 'readonly',
HTMLAudioElement: 'readonly',
Element: 'readonly',
HTMLElement: 'readonly',
Event: 'readonly',
TouchEvent: 'readonly',
CustomEvent: 'readonly',
MutationObserver: 'readonly',
IntersectionObserver: 'readonly',
ResizeObserver: 'readonly',
CanvasRenderingContext2D: 'readonly',
HTMLCanvasElement: 'readonly',
SVGElement: 'readonly',
navigator: 'readonly',
MediaMetadata: 'readonly',
Node: 'readonly',
isFinite: 'readonly',
},
},
rules: {
'no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}],
'no-undef': 'error',
'no-multiple-empty-lines': ['error', { max: 1 }],
'no-trailing-spaces': 'error',
'semi': ['error', 'always'],
'quotes': ['error', 'single'],
'indent': ['error', 4],
'comma-dangle': ['error', 'only-multiline'],
'prefer-const': 'warn',
'arrow-spacing': 'error',
'block-spacing': 'error',
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
}],
'no-empty': 'off',
'no-restricted-syntax': [
'error',
{
selector: 'AssignmentExpression[left.property.name="innerHTML"]',
message: 'Direct innerHTML assignment is banned for XSS prevention. Use dom.js helpers (setTrustedHTML for trusted content, setText for user content).',
},
],
},
},
{
files: ['static/js/studio/dom.js'],
rules: {
'no-restricted-syntax': 'off',
},
},
{
ignores: ['e2e/**/*.js', 'playwright.config.js', '.venv/**', 'node_modules/**', 'static/js/studio/api.bundle.js'],
},
];