-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
99 lines (96 loc) · 2.82 KB
/
.eslintrc.cjs
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
96
97
98
99
/** @type {import('eslint').ESLint.Options}*/
const config = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'code-import-patterns'],
settings: {
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.mts', '.tsx'],
},
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
env: {
browser: true,
node: true,
worker: true,
},
rules: {
'import/no-unresolved': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
},
],
'react/prop-types': 'off',
'no-undef': 'off',
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': ['warn'],
'no-unused-vars': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/ban-ts-comment': [
'warn',
{
'ts-ignore': 'allow-with-description',
},
],
'code-import-patterns/patterns': [
'error',
{
zones: [
{
target: /packages\/browser\/.+/,
forbiddenPatterns: [
{
pattern: /@local\/worker/,
errorMessage:
'Worker modules cannot be imported in this browser bundled file. Instead, move your shared code to packages/shared and import via @local/shared',
},
],
},
{
target: /packages\/worker\/.+/,
forbiddenPatterns: [
{
pattern: /@local\/browser/,
errorMessage:
'Browser modules cannot be imported in this worker bundled file. Instead, move your shared code to packages/shared and import via @local/shared',
},
],
},
{
target: /packages\/shared\/.+/,
forbiddenPatterns: [
{
pattern: /@local\/worker/,
errorMessage:
'Worker specific code cannot be imported in the shared package. Instead, move your shared code to packages/shared and import via @local/shared',
},
{
pattern: /@local\/browser/,
errorMessage:
'Browser specific code cannot be imported in the shared package. Instead, move your shared code to packages/shared and import via @local/shared',
},
],
},
],
},
],
},
}
module.exports = config