forked from nanalmoa/nanalmoa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
76 lines (73 loc) · 1.9 KB
/
eslint.config.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
import js from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'
import importPlugin from 'eslint-plugin-import'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import reactRefreshPlugin from 'eslint-plugin-react-refresh'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: [
'**/node_modules',
'packages/*/dist',
'packages/*/dev-dist',
'packages/*/build',
'packages/*/*.config.{js,ts}',
],
},
// common config
{
files: ['**/*.{ts,tsx,js,jsx}'],
languageOptions: {
sourceType: 'module',
ecmaVersion: 2020,
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.base.json',
tsconfigRootDir: import.meta.dirname,
},
},
extends: [
js.configs.recommended,
// legacy config: extends: ['plugin:@typescript-eslint/recommended'],
...tseslint.configs.recommended,
eslintConfigPrettier,
],
plugins: {
import: importPlugin,
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
},
},
// client config
{
files: ['packages/client/**/*.{ts,tsx,js,jsx}'],
languageOptions: {
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooksPlugin,
'react-refresh': reactRefreshPlugin,
},
rules: {
...reactHooksPlugin.configs.recommended.rules,
'@typescript-eslint/no-empty-object-type': ['off'],
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
// server config
{
files: ['packages/server/**/*.{ts,js}'],
languageOptions: {
globals: { ...globals.node, ...globals.jest },
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
)