-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.js
108 lines (105 loc) · 3.01 KB
/
index.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
/** @type {import('eslint').Linter.Config} */
module.exports = {
env: {
node: true,
},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:promise/recommended',
'standard',
],
rules: {
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'no-console': 'error',
'no-empty-function': 'off',
'no-implicit-coercion': ['error', { allow: ['!!'] }],
'no-return-await': 'error',
'no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
'no-unused-vars': [
'error',
{ ignoreRestSiblings: true, argsIgnorePattern: '^_+$' },
],
'no-use-before-define': ['error', { functions: false }],
'no-void': ['error', { allowAsStatement: true }],
'object-shorthand': ['error', 'properties'],
'require-atomic-updates': 'off',
'import/order': [
'error',
{
'newlines-between': 'always',
pathGroups: [
{
pattern: '@/**',
group: 'parent',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'import/newline-after-import': 'error',
'promise/catch-or-return': ['error', { allowFinally: true }],
'promise/prefer-await-to-callbacks': 'error',
'promise/prefer-await-to-then': 'error',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
parser: '@typescript-eslint/parser',
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
rules: {
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-object-type': [
'error',
{ allowInterfaces: 'always' },
],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false },
],
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true, argsIgnorePattern: '^_+$' },
],
// '@typescript-eslint/naming-convention': createNamingConventionConfig(),
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-named-as-default-member': 'off',
},
},
],
}