-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
122 lines (120 loc) · 2.46 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/** @type {import('eslint').Linter.Config} */
module.exports = {
'root': true,
'env': {
'browser': true,
'es2021': true,
'es6': true,
},
'extends': [
'eslint:recommended',
'plugin:@stylistic/disable-legacy',
'plugin:tailwindcss/recommended',
'plugin:import/recommended',
],
'plugins': [
'@stylistic',
],
'rules': {
// ts/js rules
'@stylistic/indent': [
'error',
2
],
'@stylistic/semi': [
'error',
'always'
],
'@stylistic/space-before-blocks': [
'error',
'always'
],
'@stylistic/quotes': [
'error',
'single'
],
'@stylistic/no-trailing-spaces': 'error',
// jsx rules
'@stylistic/jsx-quotes': [
'error',
'prefer-single'
],
'@stylistic/jsx-tag-spacing': [
'error',
{
'closingSlash': 'never',
'beforeSelfClosing': 'always',
'afterOpening': 'never',
'beforeClosing': 'never'
}
],
///tailwind rules
'tailwindcss/classnames-order': [
'error'
],
'tailwindcss/no-custom-classname': 'off'
},
'overrides': [
{
'env': {
'node': true
},
'files': [
'.eslintrc.{js,cjs}'
],
'parserOptions': {
'sourceType': 'script'
},
},
// React
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: [
'react',
'react-hooks',
'jsx-a11y'
],
extends: [
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended'
],
settings: {
react: {
version: 'detect',
},
},
},
// TS
{
files: ['**/*.{ts,tsx}'],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'./tsconfig.base.json',
'./apps/*/tsconfig.json',
'./packages/*/tsconfig.json'
],
ecmaVersion: 'latest',
sourceType: 'module'
},
extends: [
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:import/typescript',
],
settings: {
'import/resolver': {
'typescript': {
'project': [
'packages/*/tsconfig.json',
'apps/*/tsconfig.json'
]
}
},
}
},
],
};