-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.js
95 lines (95 loc) · 2.35 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
86
87
88
89
90
91
92
93
94
95
module.exports = {
root: true,
ignorePatterns: [
'node_modules/*',
'**/node_modules/',
'cdk.out/',
'.prettierrc.js',
'.eslintrc.js',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: './',
},
plugins: ['import', '@typescript-eslint', 'jest', 'prettier'],
extends: [
'eslint:recommended',
'airbnb-base',
'prettier',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'no-use-before-define': [
'error',
{functions: false, classes: true, variables: true},
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
],
// for lambda layer imports starting with /opt/nodejs/ directory
'import/no-unresolved': ['warn', {ignore: ['/opt/*']}],
'import/prefer-default-export': 'off',
'lines-between-class-members': [
'error',
'always',
{exceptAfterSingleLine: true},
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-new': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
'prettier/prettier': ['error'],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
env: {
'jest/globals': true,
},
globals: {
page: true,
browser: true,
context: true,
jestPuppeteer: true,
document: true,
localStorage: true,
},
settings: {
'import/core-modules': ['aws-sdk'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
node: {
paths: ['src'],
moduleDirectory: ['node_modules', 'src/'],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
},
},
},
};