-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.js
109 lines (109 loc) · 3.32 KB
/
core.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
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'standard',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:import/typescript',
],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
'import',
],
rules: {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/explicit-member-accessibility': ['off', { accessibility: 'explicit' }],
'indent': 'off', // TS-Eslint handles it
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
}],
'@typescript-eslint/prefer-for-of': 'error',
'semi': 'off', // TS-Eslint handles it
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/space-within-parens': ['off', 'never'],
'@typescript-eslint/unified-signatures': 'error',
'space-before-function-paren': 'off', // TS-Eslint handles it
'@typescript-eslint/space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
}],
'arrow-body-style': 'off', // it wasn't detecting comments, might think of adding it in the future
'comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
imports: 'always-multiline',
objects: 'always-multiline',
}],
'guard-for-in': 'error',
'id-match': 'error',
'import/order': ['error', {
'newlines-between': 'never',
'alphabetize': {
order: 'asc',
},
'groups': [
['builtin', 'external', 'internal'],
['parent', 'sibling', 'index'],
],
}],
'import/default': 'off',
'import/export': 'error',
'import/named': 'off',
'import/namespace': 'error',
'import/no-duplicates': 'warn',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'error',
'max-classes-per-file': ['error', 1],
'no-bitwise': 'error',
'no-caller': 'error',
'no-new-wrappers': 'error',
'no-shadow': ['error', { hoist: 'all' }],
'no-underscore-dangle': 'off', /* we want to activate this in the future */
'no-unused-vars': 'off', // handled by typescript-eslint
'object-shorthand': 'error',
'operator-linebreak': ['error', 'before'],
'one-var': ['error', 'never'],
'quote-props': ['error', 'consistent-as-needed'],
'radix': 'error',
// 'no-undef': 0, ??
},
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<roo/>@types` directory even it doesn't contain any source code, like `@types/unist`
},
},
},
}