-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
57 lines (56 loc) · 1.6 KB
/
eslint.config.js
File metadata and controls
57 lines (56 loc) · 1.6 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
const js = require('@eslint/js')
const tseslint = require('typescript-eslint')
const importPlugin = require('eslint-plugin-import')
const simpleImportSort = require('eslint-plugin-simple-import-sort')
const jestPlugin = require('eslint-plugin-jest')
const prettierConfig = require('eslint-config-prettier')
const globals = require('globals')
module.exports = tseslint.config(
{
ignores: ['node_modules/**', 'dist/**', '.swc/**', 'coverage/**'],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.node,
},
},
plugins: {
import: importPlugin,
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'error',
'import/no-duplicates': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'max-len': ['warn', { code: 240 }],
'no-console': 'off',
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['src/*'],
message: 'Use relative imports instead of absolute "src/" imports to ensure proper runtime module resolution.',
},
],
},
],
},
},
{
files: ['**/*.test.(j|t)s', '**/*.spec.(j|t)s', '**/test/**/*.(j|t)s'],
plugins: {
jest: jestPlugin,
},
rules: {
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
},
},
prettierConfig,
)