-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
118 lines (118 loc) · 3.48 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
module.exports = {
extends: [
'airbnb-base',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
allowImportExportEverywhere: true,
},
plugins: [
'prefer-object-spread',
'@typescript-eslint',
],
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
node: {
extensions: ['.js', '.ts', '.json'],
},
},
'import/extensions': [
'.ts',
],
},
rules: {
/*
* Typescript
*/
'no-void': ['error', { allowAsStatement: true }],
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'import/extensions': 'off',
'import/no-cycle': ['error', { maxDepth: 1 }],
'@typescript-eslint/restrict-template-expressions': ['error', {
allowNullish: true,
}],
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: {
delimiter: 'comma',
requireLast: true,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
}],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
}],
/*
* Airbnb
*/
// Overrides
'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
'func-names': 'error', // Changed from 'warn' to 'error'.
'import/no-absolute-path': 'off', // Turned off because we use absolute paths instead of '../'.
'implicit-arrow-linebreak': 'off', // Turned of because of bullshit
'no-alert': 'error', // Changed from 'warn' to 'error'.
'no-console': 'off', // Changed from 'warn' to 'error'.
'no-constant-condition': 'error', // Changed from 'warn' to 'error'.
'no-underscore-dangle': ['error', { // Make some exceptions for often used fields
allow: [
'_id',
'_aggregated',
'_details',
],
}],
semi: ['error', 'never'], // Changed from 'always' to 'never', because we never use semicolons.
// Additions
'no-warning-comments': 'warn',
'import/order': ['error', {
groups: [
'internal',
'builtin',
'external',
'parent',
'sibling',
'index',
],
'newlines-between': 'never',
}],
/*
* Extentions
*/
'no-use-before-define': ['error', { functions: false }],
'object-curly-newline': 'off',
'max-len': [
2,
{
code: 100,
ignoreComments: true,
ignoreUrls: true,
ignoreTemplateLiterals: true,
ignorePattern: "mf\\s*\\(\\s*(['\"])(.*?)\\1\\s*,\\s*.*?\\s*,?\\s*(['\"])(.*?)\\3,?.*?\\)",
},
],
'prefer-object-spread/prefer-object-spread': 'error',
'object-shorthand': ['error', 'always'],
},
}