forked from georchestra/sviewer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
72 lines (71 loc) · 2.52 KB
/
Copy patheslint.config.js
File metadata and controls
72 lines (71 loc) · 2.52 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
import js from '@eslint/js';
import globals from 'globals';
import security from 'eslint-plugin-security';
export default [
{
ignores: ['static/js/*.min.js', 'static/js/sviewer.min.js', 'static/js/embed.min.js', 'static/lib/**', 'node_modules/**']
},
{
files: ['js/sviewer.js', 'js/embed.js', 'static/js/i18n.js'],
languageOptions: {
ecmaVersion: 2017,
sourceType: 'script',
globals: {
...globals.browser,
'$': 'readonly',
'jQuery': 'readonly',
'Mustache': 'readonly',
'ol': 'readonly',
'bootstrap': 'readonly',
'QRCode': 'readonly',
'SViewer': 'writable',
'customConfig': 'readonly',
'SViewerHardConfig': 'writable',
'SViewerConfig': 'readonly',
'SViewerState': 'writable',
'SViewerTemplates': 'writable',
'SViewerAdapters': 'writable',
'log': 'readonly',
'parseISOMetadata': 'readonly',
'buildISOTable': 'readonly',
'XPathResult': 'readonly',
}
},
plugins: { security },
rules: {
...js.configs.recommended.rules,
'no-unused-vars': ['warn', { vars: 'all', args: 'none', caughtErrors: 'all', caughtErrorsIgnorePattern: '^_' }],
'no-redeclare': 'off',
'no-undef': 'error',
'eqeqeq': ['warn', 'always', { null: 'ignore' }],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-new-func': 'error',
'no-proto': 'error',
'no-extend-native': 'error',
'no-global-assign': 'error',
'no-loss-of-precision': 'off',
'complexity': ['warn', { max: 20 }],
'security/detect-eval-with-expression': 'error',
'security/detect-object-injection': 'off',
'security/detect-non-literal-regexp': 'warn'
}
},
{
// Extensions — ES2017, relaxed (third-party authors, modern browsers only)
files: ['ext/**/*.js'],
languageOptions: {
ecmaVersion: 2017,
globals: {
...globals.browser,
'$': 'readonly',
'SViewer': 'readonly'
}
},
rules: {
'no-var': 'off',
'eqeqeq': ['warn', 'always', { null: 'ignore' }],
'no-eval': 'error'
}
}
];