-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
52 lines (51 loc) · 1.62 KB
/
eslint.config.js
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
// eslint-disable-next-line no-undef
const js = require('@eslint/js');
// eslint-disable-next-line no-undef
const typescript = require('@typescript-eslint/eslint-plugin');
// eslint-disable-next-line no-undef
const typescriptParser = require('@typescript-eslint/parser');
// eslint-disable-next-line no-undef
module.exports = [
js.configs.recommended,
{
files: ['src/**/*.ts'],
ignores: ['**/node_modules/**', '**/dist/**'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
},
globals: {
NodeJS: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
console: 'readonly',
},
},
plugins: {
'@typescript-eslint': typescript,
},
rules: {
...typescript.configs['recommended'].rules,
quotes: ['error', 'single'],
indent: ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'dot-notation': 'error',
eqeqeq: ['error', 'smart'],
curly: ['error', 'all'],
'brace-style': ['error'],
'prefer-arrow-callback': 'warn',
'max-len': ['warn', 160],
'object-curly-spacing': ['error', 'always'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error', { classes: false, enums: false }],
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'none' }],
},
},
];