forked from chrisbenincasa/tunarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
84 lines (83 loc) · 2.07 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
77
78
79
80
81
82
83
84
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint, { parser } from 'typescript-eslint';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import jsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js';
import reactRefresh from 'eslint-plugin-react-refresh';
import reactHooks from 'eslint-plugin-react-hooks';
import noUnusedImports from 'eslint-plugin-unused-imports';
export default tseslint.config(
{
ignores: [
'**/.tsup/*',
'**/dist/*',
'**/build/*',
'**/scripts/*',
'**/*.config.ts',
'**/*.ignore.ts',
'**/*.test.ts', // Ignore test files for now, until we fix up tsconfig files
'server/src/migrations/**/*.ts', // Ignore DB migration files
],
},
{
plugins: {
'unused-imports': noUnusedImports,
},
rules: {
'unused-imports/no-unused-imports': 'error',
},
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
project: [
'./server/tsconfig.json',
'./shared/tsconfig.json',
'./types/tsconfig.json',
'./web/tsconfig.build.json',
],
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['web/src/**/*.tsx', 'web/src/**/*.ts'],
...reactRecommended,
extends: [jsxRuntime],
plugins: {
// react,
'react-refresh': reactRefresh,
'react-hooks': reactHooks,
},
languageOptions: {
parser,
ecmaVersion: 2020,
globals: {
...globals.browser,
},
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
// Don't error on promise-returning functions in JSX attributes
'@typescript-eslint/no-misused-promises': [
2,
{
checksVoidReturn: {
attributes: false,
},
},
],
},
settings: {
react: {
version: 'detect',
},
},
},
);