-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy patheslint.config.mjs
More file actions
55 lines (54 loc) · 1.74 KB
/
Copy patheslint.config.mjs
File metadata and controls
55 lines (54 loc) · 1.74 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
import eslintReact from '@eslint-react/eslint-plugin';
import js from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import { defineConfig, globalIgnores } from 'eslint/config';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default defineConfig([
globalIgnores(['dist', 'node_modules', 'build', 'eslint.config.mjs']),
{
files: ['**/*.{ts,tsx}'],
plugins: {
'@stylistic': stylistic,
},
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
eslintReact.configs['recommended-typescript'],
eslintConfigPrettier,
],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
// Enable project service for better TypeScript integration
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
ecmaVersion: 2022,
globals: globals.browser,
sourceType: 'module',
},
rules: {
'@eslint-react/no-leaked-conditional-rendering': 'warn',
'@stylistic/jsx-curly-brace-presence': [
'warn',
{ props: 'never', children: 'never', propElementValues: 'always' },
],
'@stylistic/quotes': ['warn', 'single'],
'@typescript-eslint/no-empty-object-type': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
},
],
},
},
]);