-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
63 lines (62 loc) · 1.93 KB
/
eslint.config.mjs
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
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import eslintReact from 'eslint-plugin-react';
import eslintReactHooks from 'eslint-plugin-react-hooks';
import prettierPlugin from 'eslint-plugin-prettier';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
import eslintPluginImport from 'eslint-plugin-import';
/** @type {import('eslint').Linter.FlatConfig[]} */
export default tseslint.config(
{
plugins: {
'@typescript-eslint': tseslint.plugin,
'react': eslintReact,
'react-hooks': eslintReactHooks,
prettier: prettierPlugin,
'simple-import-sort': eslintPluginSimpleImportSort,
'import': eslintPluginImport,
},
},
{
ignores: ['dist', 'node_modules', 'coverage', 'eslint.config.mjs', "icons"],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2020,
},
parserOptions: {
project: ['tsconfig.json'],
},
parser: tseslint.parser,
ecmaVersion: 'latest'
},
},
{
files: ['**/*.{ts,tsx}'],
extends: [tseslint.configs.disableTypeChecked],
rules: {
...eslintConfigPrettier.rules,
...eslintPluginImport.configs.recommended.rules,
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'prettier/prettier': 'warn',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'warn',
'import/first': 'error',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'off',
'import/no-unresolved': 'off',
'import/no-named-as-default-member': 'off',
'import/namespace': 'off',
'import/named': 'off',
'@typescript-eslint/no-require-imports': 'off'
},
},
);