-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
81 lines (76 loc) · 1.51 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
const rules = {
'unicorn/no-array-for-each': 2,
};
const tsWebRules = {
...rules,
'@next/next/no-html-link-for-pages': 0,
'react-hooks/exhaustive-deps': 2,
};
const tsWebTestRules = {
...tsWebRules,
'testing-library/no-wait-for-side-effects': 0,
'no-restricted-imports': [
'error',
{
name: '@testing-library/react',
message: 'Please use tests/test-utils instead.',
},
],
};
const project = [
'./frontend/tsconfig.json',
'./services/*/tsconfig.json',
'./tsconfig.json',
];
const settings = {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
project,
},
},
};
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project,
},
settings,
ignorePatterns: ['.eslintrc.js', '**/*.js', '*.js', 'gen/**/*.*'],
extends: ['@tool-belt/eslint-config'],
rules,
overrides: [
{
files: ['services/**/tests/**/*.ts'],
extends: ['@tool-belt/eslint-config', 'plugin:vitest/recommended'],
rules,
},
{
files: ['frontend/**/*.{ts,tsx}'],
excludedFiles: [
'frontend/**/tests/**/*.{ts,tsx}',
'frontend/**/*.spec.{ts,tsx}',
],
extends: [
'@tool-belt/eslint-config/react',
'plugin:@next/next/recommended',
],
rules: tsWebRules,
},
{
files: [
'frontend/**/tests/**/*.{ts,tsx}',
'frontend/**/*.spec.{ts,tsx}',
],
extends: [
'@tool-belt/eslint-config/react',
'plugin:vitest/recommended',
],
rules: tsWebTestRules,
},
],
};