-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy patheslint.config.js
More file actions
91 lines (88 loc) · 2.68 KB
/
eslint.config.js
File metadata and controls
91 lines (88 loc) · 2.68 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
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import litPlugin from 'eslint-plugin-lit';
export default [
js.configs.recommended,
{
files: ['src/**/*.ts'],
plugins: {
'@typescript-eslint': tseslint,
lit: litPlugin
},
languageOptions: {
parser: tsparser,
ecmaVersion: 2022,
sourceType: 'module',
parserOptions: {
project: './tsconfig.json'
},
globals: {
window: 'readonly',
navigator: 'readonly',
document: 'readonly',
console: 'readonly',
i18next: 'readonly',
URL: 'readonly',
Event: 'readonly',
customElements: 'readonly',
HTMLElement: 'readonly',
CustomEvent: 'readonly',
Date: 'readonly',
Math: 'readonly',
ResizeObserver: 'readonly',
cancelAnimationFrame: 'readonly',
requestAnimationFrame: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
DOMParser: 'readonly'
}
},
rules: {
// Disable base rule as TypeScript version is used
'no-unused-vars': 'off',
// TypeScript-specific rules
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
// General JavaScript rules
'no-console': 'off',
'no-debugger': 'error',
'semi': ['error', 'always'],
'quotes': ['error', 'single', { avoidEscape: true }],
'indent': ['error', 2, { SwitchCase: 1 }],
'comma-dangle': ['error', 'never'],
'eol-last': ['error', 'always'],
'no-trailing-spaces': 'error',
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'arrow-spacing': 'error',
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-infix-ops': 'error',
'no-multi-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
'prefer-const': 'error',
'no-var': 'error',
// Lit-specific rules
'lit/no-duplicate-template-bindings': 'error',
'lit/no-legacy-template-syntax': 'error',
'lit/no-useless-template-literals': 'warn'
}
},
{
ignores: [
'node_modules/**',
'dynamic-weather-card.js',
'dist/**',
'*.config.js'
]
},
];