-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy patheslint.config.js
More file actions
45 lines (43 loc) · 1.31 KB
/
Copy patheslint.config.js
File metadata and controls
45 lines (43 loc) · 1.31 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
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import globals from 'globals';
import prettier from 'eslint-config-prettier';
// Trim any accidental whitespace from global names provided by the `globals`
// package. Older versions contain a key `AudioWorkletGlobalScope ` with a
// trailing space which breaks ESLint's flat config parser.
const trimmedBrowserGlobals = Object.fromEntries(
Object.entries(globals.browser).map(([key, value]) => [key.trim(), value])
);
export default [
js.configs.recommended,
prettier,
{
files: ['**/*.ts', '**/*.js'],
languageOptions: {
parser: tsparser,
ecmaVersion: 'latest',
globals: {
...globals.node,
...globals.jest,
...trimmedBrowserGlobals,
jQuery: 'readonly',
$: 'readonly',
ipcRenderer: 'readonly',
remote: 'readonly',
settings: 'readonly',
HTMLElement: 'readonly'
}
},
plugins: { '@typescript-eslint': tseslint },
rules: {
'no-unused-vars': 'off',
'no-undef': 'off',
'no-fallthrough': 'off',
'no-prototype-builtins': 'off',
'no-control-regex': 'off',
'no-useless-escape': 'off',
'no-empty': ['error', { allowEmptyCatch: true }]
}
}
];