-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
97 lines (96 loc) · 2.45 KB
/
.eslintrc.cjs
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
92
93
94
95
96
97
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: [
'@typescript-eslint/eslint-plugin',
'eslint-plugin-canonical',
'import',
'jest',
],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: [
'.eslintcache',
'.eslintrc.js',
'/eslint-plugin-loop',
'/dist',
'*.d.ts',
'**/*.d.ts',
'**/*.cjs',
],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-misused-promises': ['error'],
'@typescript-eslint/no-non-null-assertion': ['error'],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'canonical/filename-match-regex': [
'error',
{ regex: '^[0-9a-z-.]+$', ignoreExporting: false },
],
'import/default': 'off',
'import/namespace': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'sibling', 'index'],
alphabetize: {
order: 'asc',
caseInsensitive: false,
},
'newlines-between': 'always-and-inside-groups',
},
],
'jest/no-identical-title': 'error',
// Prettier takes care of code width. This is just for comments.
'max-len': [
'error',
{
code: Infinity,
comments: 100,
ignorePattern: '( = |eslint|http|AND |src|ts-ignore|yarn)',
},
],
'no-console': 'error',
'no-debugger': 'error',
'no-useless-catch': 'error',
'no-useless-return': 'error',
'prefer-template': 'error',
'sort-imports': 'off',
quotes: [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false },
],
},
settings: {
'import/resolver': {
typescript: true, // this loads <rootdir>/tsconfig.json to eslint
node: true,
},
},
};