-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
70 lines (67 loc) · 2.06 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import js from '@eslint/js'
import globals from 'globals'
import prettier from 'eslint-config-prettier'
import ts from 'typescript-eslint'
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
export default [
js.configs.recommended,
...ts.configs.strictTypeChecked,
...ts.configs.stylisticTypeChecked,
prettier,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {...globals.node},
parserOptions: {
project: true,
tsconfigRoot: import.meta.dirname,
},
},
rules: {
'array-callback-return': 'error',
camelcase: ['warn', {properties: 'never', ignoreDestructuring: true}],
'consistent-this': ['error', 'self'],
curly: ['warn', 'multi-line'],
'guard-for-in': 'error',
eqeqeq: ['error', 'always', {null: 'ignore'}],
'linebreak-style': ['error', 'unix'],
'new-cap': 'off',
'no-await-in-loop': 'warn',
'no-case-declarations': 'error',
'no-confusing-arrow': 'off',
'no-console': 'off',
'no-div-regex': 'error',
'no-eq-null': 'warn',
'no-extra-label': 'error',
'no-implicit-coercion': ['error', {boolean: true, number: true, string: true}],
'no-implicit-globals': 'error',
'no-multi-assign': 'error',
'no-new-symbol': 'error',
'no-restricted-syntax': ['error', 'WithStatement'],
'no-return-await': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'off',
'no-underscore-dangle': 'off',
'no-unmodified-loop-condition': 'error',
'@typescript-eslint/no-unused-vars': ['warn', {args: 'after-used', argsIgnorePattern: '^_'}],
'no-useless-constructor': 'error',
'no-var': 'error',
'prefer-const': 'off',
'prefer-promise-reject-errors': 'error',
'prefer-spread': 'error',
quotes: ['warn', 'single', 'avoid-escape'],
'require-await': 'warn',
semi: 'off',
// conflicts with the noPropertyAccessFromIndexSignature tsconfig rule
'@typescript-eslint/dot-notation': ['error', {allowIndexSignaturePropertyAccess: true}],
},
},
{
files: ['**/*.js'],
...ts.configs.disableTypeChecked,
},
{
ignores: ['dist/*'],
},
]