-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
85 lines (85 loc) · 2.01 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
module.exports = {
env: {
es2021: true,
node: true,
mocha: true,
},
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:import/recommended',
'plugin:import/typescript',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
project: './tsconfig.json',
},
plugins: ['@typescript-eslint', 'no-only-tests'],
rules: {
'import/extensions': ['warn', 'never', { json: 'always' }],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'src/**/*.test.ts',
'src/**/*.test.utils.ts',
'src/**/*-factory.ts',
'src/commons/tests/**/*.ts'
],
packageDir: './',
},
],
'import/order': [
'error',
{ groups: [['builtin', 'external']], 'newlines-between': 'never' },
],
'import/prefer-default-export': 'off',
'max-len': [
'error',
{ code: 100, ignoreStrings: true, ignoreComments: true },
],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
},
],
'@typescript-eslint/no-shadow': ['error'],
'no-only-tests/no-only-tests': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
'space-before-blocks': 'error',
'@typescript-eslint/space-before-blocks': 'error',
'no-console': 'warn',
},
overrides: [
{
files: ['**/handlers/**/index.test.ts'],
rules: {
'global-require': 'off',
},
},
{
files: ['*.test.ts', '*.test.utils.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['**/serverless.ts'],
rules: {
'import/no-import-module-exports': 'off',
'no-template-curly-in-string': 'off',
},
},
],
settings: {
'import/resolver': {
typescript: true,
node: true,
},
},
};