-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.mjs
106 lines (98 loc) · 2.51 KB
/
eslint.config.mjs
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
import react from '@eslint-react/eslint-plugin'
import { sxzz } from '@sxzz/eslint-config'
import reactHooks from 'eslint-plugin-react-hooks'
export default sxzz(
[
{
files: ['apps/web/**/*.{ts,tsx}'],
...react.configs.recommended,
},
{
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
files: ['apps/web/**/*.{ts,tsx}'],
plugins: {
'react-hooks': reactHooks,
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
},
{
files: ['apps/core/src/**/*.{ts,tsx}'],
languageOptions: {
parserOptions: {
emitDecoratorMetadata: true,
experimentalDecorators: true,
},
},
rules: {
'@typescript-eslint/no-var-requires': 0,
},
},
{
ignores: [
'external/**/*',
'test/**/*.{ts,tsx}',
'drizzle/**/*.js',
'drizzle/meta/**',
'drizzle.config.ts',
'apps/web/cssAsPlugin.js',
],
},
{
files: [
'packages/**/*.{ts,tsx}',
'drizzle/**/*.{ts,tsx}',
'apps/**/*.{ts,tsx}',
],
rules: {
'import/order': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
eqeqeq: 'off',
'no-void': 0,
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/consistent-type-assertions': 0,
'no-restricted-syntax': 0,
'unicorn/filename-case': 0,
'unicorn/prefer-math-trunc': 0,
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
// for node server runtime
'require-await': 0,
'unicorn/no-array-callback-reference': 0,
'node/prefer-global/process': 0,
'node/prefer-global/buffer': 'off',
'no-duplicate-imports': 'off',
'unicorn/explicit-length-check': 0,
'unicorn/prefer-top-level-await': 0,
// readable push syntax
'unicorn/no-array-push-push': 0,
'unicorn/custom-error-definition': 0,
},
},
],
{
prettier: true,
markdown: true,
vue: false,
unocss: false,
},
)