-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
72 lines (70 loc) · 2.13 KB
/
.eslintrc.cjs
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
module.exports = {
extends: [
'eslint:recommended',
'airbnb',
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'prettier',
],
overrides: [
// allow console and default export only outside of src/ (scripts, config, etc.)
{
files: ['**/src/**'],
rules: {
'no-console': 'warn',
'import/no-default-export': 'error',
},
},
// allow .ts import for tests
{
files: ['**/__tests__/**', '**/e2e/**'],
rules: {
'import/extensions': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
],
rules: {
curly: 'error',
'no-console': 'off',
'prettier/prettier': 'error',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/strict-boolean-expressions': 'error',
'import/order': 'warn',
'no-underscore-dangle': ['warn', { allow: ['_id', '__typename', '__filename', '__dirname'] }],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': 'off', // handled by typescript compiler
'@typescript-eslint/no-unnecessary-condition': 'error',
'no-restricted-syntax': 'off', // since we target modern browsers, we can use for-of
'sql/format': [
'error',
{
ignoreExpressions: false,
ignoreInline: true,
ignoreTagless: false,
ignoreBaseIndent: true,
},
],
'sql/no-unsafe-query': 'off',
},
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint', 'sql'],
parserOptions: {
root: true,
project: [
`${__dirname}/tsconfig.json`,
`${__dirname}/config/tsconfig.json`,
`${__dirname}/client/tsconfig.json`,
`${__dirname}/client/tsconfig.node.json`,
`${__dirname}/server/tsconfig.json`,
`${__dirname}/worker/tsconfig.json`,
`${__dirname}/db/tsconfig.spec.json`,
`${__dirname}/server/tsconfig.spec.json`,
`${__dirname}/e2e/cypress/tsconfig.json`,
],
},
};