-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
111 lines (109 loc) · 2.82 KB
/
eslint.config.js
File metadata and controls
111 lines (109 loc) · 2.82 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
const js = require('@eslint/js');
const { defineConfig } = require('eslint/config');
const prettierConfig = require('eslint-config-prettier');
const pluginImport = require('eslint-plugin-import');
const pluginReact = require('eslint-plugin-react');
const globals = require('globals');
const tseslint = require('typescript-eslint');
const tsconfigRootDir = __dirname;
const browserGlobals = globals.browser;
const nodeGlobals = globals.node;
module.exports = defineConfig([
js.configs.recommended,
prettierConfig,
{
ignores: [
'**/node_modules/**',
'**/.tanstack/**',
'**/.turbo/**',
'**/.next/**',
'**/dist/**',
'**/build/**',
'**/storybook-static/**',
'**/coverage/**',
'**/index.html',
'**/README.md',
'**/routeTree.gen.ts',
'**/reportWebVitals.ts',
'eslint.config.js',
'**/public/admin/**',
'**/public/**/assets/**',
'**/public/**/*.min.js',
],
},
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
plugins: { import: pluginImport },
languageOptions: {
globals: browserGlobals,
},
rules: {
'import/order': [
'error',
{
groups: ['builtin', 'external', ['parent', 'sibling'], 'index'],
pathGroups: [
{
pattern: 'react',
group: 'builtin',
position: 'before',
},
{
pattern: 'antd',
group: 'builtin',
position: 'before',
},
{
pattern: '~/shared/**',
group: 'external',
position: 'after',
},
{
pattern: '~/widgets/**',
group: 'external',
position: 'after',
},
{
pattern: '~/features/**',
group: 'external',
position: 'after',
},
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
},
],
},
},
{
files: ['**/*.config.{js,cjs,mjs,ts,mts,cts}'],
languageOptions: {
globals: nodeGlobals,
},
},
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
settings: { react: { version: 'detect' } },
rules: {
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
{
files: ['**/*.{ts,mts,cts,tsx}'],
languageOptions: {
parserOptions: {
tsconfigRootDir,
},
},
},
]);