-
Notifications
You must be signed in to change notification settings - Fork 0
/
backend.js
120 lines (120 loc) · 2.94 KB
/
backend.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
119
120
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
plugins: ['prettier'],
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
project: './tsconfig.json',
},
env: {
node: true,
es6: true,
jest: true,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': ['off'],
'@typescript-eslint/explicit-member-accessibility': [1],
'@typescript-eslint/interface-name-prefix': [0, 'never'],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-namespace': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '_' }],
'no-return-await': 'off',
'@typescript-eslint/return-await': ['error', 'always'],
'import/extensions': [
1,
'never',
{
svg: 'always',
},
],
'import/newline-after-import': ['error', { considerComments: true }],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
],
'no-param-reassign': 0,
'no-underscore-dangle': 0,
'no-use-before-define': 0,
'no-console': ['error', { allow: ['error', 'table'] }],
'object-shorthand': 'error',
'padding-line-between-statements': 'off',
'@typescript-eslint/padding-line-between-statements': [
'error',
// blank line before return
{ blankLine: 'always', prev: '*', next: 'return' },
// blank line before and after block like statements
{ blankLine: 'always', prev: '*', next: 'block-like' },
{ blankLine: 'always', prev: 'block-like', next: '*' },
// blank line before and after function declarations
{ blankLine: 'always', prev: '*', next: 'function' },
{ blankLine: 'always', prev: 'function', next: '*' },
],
'spaced-comment': 'error',
// default case in a switch needs to be last
'default-case-last': 'error',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
groups: ['builtin', 'external', ['internal', 'parent'], ['sibling', 'index']],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern: '@**',
group: 'internal',
position: 'before',
},
{
pattern: '@**/**',
group: 'internal',
position: 'before',
},
],
pathGroupsExcludedImportTypes: [],
},
],
'prettier/prettier': [
'error',
{
printWidth: 120,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: true,
arrowParens: 'avoid',
},
],
},
};