-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
61 lines (60 loc) · 1.44 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
const CAMEL_CASE_PATTERN = '+([a-z])*([a-z0-9])*([A-Z]*([a-z0-9]))';
const PASCAL_CASE_PATTERN = '*([A-Z]*([a-z0-9]))';
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'check-file'],
rules: {
'prettier/prettier': 'error',
'no-console': 'warn',
'import/no-default-export': 'error',
'check-file/filename-naming-convention': [
'error',
{
'**/*.{jsx,tsx,ts,js}': `@(${CAMEL_CASE_PATTERN}|${PASCAL_CASE_PATTERN})`,
},
],
'check-file/folder-naming-convention': [
'error',
{
'{lambdas,scripts}/**/': `@(${CAMEL_CASE_PATTERN}|${PASCAL_CASE_PATTERN})`,
},
],
},
ignorePatterns: ['cdk.out'],
overrides: [
{
files: ['**/*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
},
},
{
files: ['lambdas/**/*.{ts,tsx}'],
parserOptions: {
project: 'lambdas/tsconfig.json',
},
},
],
};