forked from dvla/postman-paf-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
88 lines (87 loc) · 2.29 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
const rules = {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
ts: 'never',
},
],
indent: ['error', 4, { SwitchCase: 1 }],
'max-len': [
1,
120,
{
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
ignoreUrls: true,
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^context$|^event$',
},
],
'no-underscore-dangle': ['error', { allow: ['_version'] }],
'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'prefer-regex-literals': 'off',
'jest/no-conditional-expect': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^context$|^event$',
},
],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
};
module.exports = {
root: true,
settings: {
'import/core-modules': ['aws-sdk'],
},
parserOptions: {
ecmaVersion: 2022,
},
env: {
es6: true,
jest: true,
},
extends: ['airbnb-base', 'plugin:jest/recommended', 'prettier'],
overrides: [
{
files: ['packages/**/*.ts'],
parserOptions: {
ecmaVersion: 2022,
project: './tsconfig.json',
},
plugins: ['jest'],
extends: ['airbnb-base', 'plugin:jest/recommended', 'prettier'],
rules,
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
},
},
},
},
{
files: ['packages/**/*.js'],
parserOptions: {
ecmaVersion: 2022,
},
plugins: ['jest', 'prettier'],
extends: ['airbnb-base', 'plugin:jest/recommended', 'prettier'],
rules,
},
{
files: ['**/*.test.js'],
rules: {
'no-promise-executor-return': 'off',
},
},
],
};