This repository was archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
66 lines (62 loc) · 2.23 KB
/
.eslintrc.js
File metadata and controls
66 lines (62 loc) · 2.23 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['prettier'],
env: {
es2022: true,
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: ['prettier', 'unused-imports'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'prettier/prettier': ['error'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'spaced-comment': ['error', 'always', { exceptions: ['-', '+'] }],
'unused-imports/no-unused-imports': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/return-await': 'error',
// There are cases we want an async function to have sync body, as we
// still want the result to be a Promise.
// This rule forse it to be written as `return Promise.resolve(...)`.
// TypeScript type system is strong enough so there will not be
// an useless `async` mark on the function.
'@typescript-eslint/require-await': 'off',
'prefer-const': ['error', { destructuring: 'all' }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-unnecessary-condition': [
'error',
{
allowConstantLoopConditions: true,
},
],
'no-console': 'error'
},
};