-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
101 lines (98 loc) · 2.54 KB
/
eslint.config.ts
File metadata and controls
101 lines (98 loc) · 2.54 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
import eslint from '@eslint/js'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
// plugins
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
import unusedImportsPlugin from 'eslint-plugin-unused-imports'
import tseslint from 'typescript-eslint'
const ignores = [
'node_modules',
'.pnp',
'.pnp.js',
'coverage',
'.next/',
'out/',
'build',
'.DS_Store',
'*.pem',
'npm-debug.log*',
'yarn-debug.log*',
'yarn-error.log*',
'.env',
'.env.local',
'.env.development.local',
'.env.test.local',
'.env.production.local',
'.turbo',
'.vercel',
'dist',
'data',
]
/**
* @type {import('typescript-eslint').ConfigArray}
*/
const config = tseslint.config(
{ ignores },
eslint.configs.recommended,
tseslint.configs.recommended,
eslintPluginPrettierRecommended,
{
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
},
},
{
plugins: {
'unused-imports': unusedImportsPlugin,
'simple-import-sort': simpleImportSortPlugin,
},
rules: {
'unused-imports/no-unused-imports': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': [
'error',
{
groups: [
// Side effect imports.
['^\\u0000'],
// React
['^react'],
// Node.js builtins prefixed with `node:`.
['^node:'],
// Absolute imports and other imports such as Vue-style `@app/foo`. Anything not matched in another group.
['^'],
// Internal aliases. Anything that starts with `~`.
['^~'],
// Relative imports. Anything that starts with a dot.
['^\\.'],
// Relative imports from outside. Anything that starts with a dot.
['^\\.\\.'],
],
},
],
},
},
// Override some rules
{
files: ['*.js', '*.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'no-undef': 'off',
},
}
)
export default config