-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
86 lines (84 loc) · 2.3 KB
/
eslint.config.js
File metadata and controls
86 lines (84 loc) · 2.3 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
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
import eslintConfigPrettier from 'eslint-config-prettier'
const tsconfigRootDir = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig([
globalIgnores([
'coverage',
'dist',
'playwright-report',
'reports',
'.stryker-tmp',
'.claude',
'src-tauri/target',
'src-tauri/**/target',
'var',
'test-results',
]),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
eslintConfigPrettier,
],
languageOptions: {
ecmaVersion: 'latest',
globals: globals.browser,
parserOptions: {
project: [
'./tsconfig.app.json',
'./tsconfig.eslint.json',
'./tsconfig.test.json',
],
tsconfigRootDir,
},
},
rules: {
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: {
attributes: false,
},
},
],
},
},
{
files: ['**/*.config.{js,ts}', '**/*.test.{ts,tsx}', 'tests/**/*.{ts,tsx}'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
},
},
// shadcn primitives are scaffolded templates and export companion non-component
// utilities (cva variants, helpers). React-refresh's "components only" rule is
// about HMR ergonomics rather than correctness — relax it for this directory.
{
files: ['src/components/ui/**/*.{ts,tsx}'],
rules: {
'react-refresh/only-export-components': 'off',
},
},
])