-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy patheslint.config.js
More file actions
51 lines (50 loc) · 1.47 KB
/
eslint.config.js
File metadata and controls
51 lines (50 loc) · 1.47 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
const js = require('@eslint/js');
const typescript = require('@typescript-eslint/eslint-plugin');
const typescriptParser = require('@typescript-eslint/parser');
module.exports = [
js.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
// Browser globals
document: 'readonly',
window: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
CustomEvent: 'readonly',
HTMLElement: 'readonly',
MouseEvent: 'readonly',
// Jest globals
describe: 'readonly',
it: 'readonly',
expect: 'readonly',
// Stencil globals
h: 'readonly',
HTMLIonModalElement: 'readonly',
HTMLIonInfiniteScrollElement: 'readonly',
HTMLIonProgressBarElement: 'readonly',
HTMLIonRefresherElement: 'readonly',
HTMLIonReorderGroupElement: 'readonly'
}
},
plugins: {
'@typescript-eslint': typescript,
},
rules: {
...typescript.configs.recommended.rules,
// Allow both 'h' and '_template_' to be unused
'@typescript-eslint/no-unused-vars': ['error', {
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^(h|_template_)$'
}],
// Allow any type in certain cases
'@typescript-eslint/no-explicit-any': 'off'
},
},
];