-
-
Notifications
You must be signed in to change notification settings - Fork 418
/
Copy patheslint.config.ts
62 lines (60 loc) · 1.78 KB
/
eslint.config.ts
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
import { fixupConfigRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import eslintPluginImportX from 'eslint-plugin-import-x';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import reactPlugin from 'eslint-plugin-react';
import globals from 'globals';
import ts from 'typescript-eslint';
export default ts.config(
// Shared configs
js.configs.recommended,
...ts.configs.recommended,
jsxA11y.flatConfigs.recommended,
eslintPluginImportX.flatConfigs.recommended,
eslintPluginImportX.flatConfigs.typescript,
eslintPluginPrettierRecommended,
...fixupConfigRules(new FlatCompat().extends('plugin:react-hooks/recommended')),
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
...reactPlugin.configs.flat.recommended,
...reactPlugin.configs.flat['jsx-runtime'],
},
// Custom config
{
ignores: ['**/build/**', '**/dist/**', '**/node_modules/**', 'eslint.config.js'],
},
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
languageOptions: {
parser: ts.parser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.es2020,
...globals.node,
chrome: 'readonly',
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/react-in-jsx-scope': 'off',
'import-x/no-unresolved': 'off',
'import-x/no-named-as-default-member': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'react/prop-types': 'off',
},
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
);