-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
91 lines (89 loc) · 2.64 KB
/
.eslintrc.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'jest', 'import'], //, "prettier"],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
//"prettier/@typescript-eslint",
'plugin:import/errors',
'plugin:import/typescript',
//"plugin:prettier/recommended"
],
rules: {
// TYPESCRIPT ADDITIONAL RULES - ADDING MORE RULES TO INCREASE STRICTNESS
complexity: [2, 8],
'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
'no-useless-constructor': 'off',
'@typescript-eslint/adjacent-overload-signatures': ['error'],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/ban-types': [
'error',
{
types: {
Object: 'Avoid using the `Object` type. Did you mean `object`?',
Function:
'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
Boolean: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
Number: 'Avoid using the `Number` type. Did you mean `number`?',
String: 'Avoid using the `String` type. Did you mean `string`?',
Symbol: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
object: false,
'{}': false,
},
},
],
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/no-empty-function': [
'error',
{ allow: ['arrowFunctions'] },
],
'@typescript-eslint/no-explicit-any': ['error', { ignoreRestArgs: true }],
'@typescript-eslint/no-use-before-define': [
'error',
{
functions: false,
typedefs: false,
},
],
'@typescript-eslint/no-useless-constructor': 'error',
// note you must disable the base rule as it can report incorrect errors
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
// STYLE RULES
'brace-style': 'error',
curly: ['error'],
'eol-last': ['error', 'always'],
'import/order': [
'error',
{
groups: [
'index',
'sibling',
'parent',
'internal',
'external',
'builtin',
],
alphabetize: { order: 'asc' },
},
],
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'no-multi-spaces': [
'error',
{ exceptions: { VariableDeclarator: true, AssignmentExpression: true } },
],
'no-multiple-empty-lines': ['error', { max: 1 }],
quotes: ['error', 'single', { avoidEscape: true }],
semi: 'off',
'@typescript-eslint/semi': ['error', 'always'],
},
};