-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
120 lines (119 loc) · 3.37 KB
/
eslint.config.js
File metadata and controls
120 lines (119 loc) · 3.37 KB
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
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tsParser from '@typescript-eslint/parser'
import tsPlugin from '@typescript-eslint/eslint-plugin'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
ignores: ['backend/**', 'src/test/**'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^([A-Z_]|motion$)', argsIgnorePattern: '^(_|[A-Z])', destructuredArrayIgnorePattern: '^_' }],
'react-refresh/only-export-components': 'warn',
},
},
{
files: ['**/*.{ts,tsx}'],
ignores: ['backend/**', 'src/test/**'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
},
rules: {
'no-unused-vars': 'off',
'no-undef': 'off',
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^([A-Z_]|motion$)', argsIgnorePattern: '^(_|[A-Z])', destructuredArrayIgnorePattern: '^_' }],
'react-refresh/only-export-components': 'warn',
},
},
{
files: ['public/sw.js'],
languageOptions: {
globals: { ...globals.browser, ...globals.serviceworker },
},
},
{
files: ['tailwind.config.js', 'postcss.config.js'],
languageOptions: {
globals: globals.node,
},
},
{
files: ['vite.config.js'],
languageOptions: {
globals: globals.node,
},
},
{
files: ['src/test/**/*.{js,jsx}'],
extends: [js.configs.recommended],
languageOptions: {
ecmaVersion: 2020,
globals: { ...globals.browser, ...globals.node, ...globals.jest },
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]', argsIgnorePattern: '^(_|[A-Z])' }],
},
},
{
files: ['backend/**/*.js'],
ignores: ['backend/**/*.test.js', 'backend/**/*.spec.js'],
extends: [js.configs.recommended],
languageOptions: {
ecmaVersion: 2022,
globals: { ...globals.node, ...globals.es2021 },
sourceType: 'module',
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]', argsIgnorePattern: '^_' }],
},
},
{
files: ['backend/**/*.test.js', 'backend/**/*.spec.js'],
extends: [js.configs.recommended],
languageOptions: {
ecmaVersion: 2022,
globals: { ...globals.node, ...globals.jest, ...globals.es2021 },
sourceType: 'module',
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]', argsIgnorePattern: '^_' }],
},
},
])