-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.cjs
More file actions
85 lines (71 loc) · 2.54 KB
/
eslint.config.cjs
File metadata and controls
85 lines (71 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
// @ts-check
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const eslintConfigPrettier = require('eslint-config-prettier');
module.exports = tseslint.config(
// ESLint recommended rules
eslint.configs.recommended,
// TypeScript ESLint recommended rules
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// Prettier config to disable conflicting rules
eslintConfigPrettier,
// Global ignores
{
ignores: [
'dist/**',
'node_modules/**',
'bin/**', // CLI binary'leri
'scripts/**', // Build scripts
'*.js',
'*.mjs',
'test/**',
'test/**/**',
'**/*.test.ts',
'**/*.spec.ts',
'eslint.config.cjs', // Ignore config file itself
'*.md',
],
},
// Base configuration
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['*.js', '*.mjs', '*.cjs'],
},
tsconfigRootDir: __dirname,
},
},
},
// Custom rules
{
rules: {
// TypeScript rules
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/method-signature-style': 'off',
// Relax some strict TypeScript rules for decorator metadata
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'off',
// Allow empty interfaces (common in TypeScript patterns)
'@typescript-eslint/no-empty-interface': 'off',
// Allow require() in specific cases (Bun compatibility)
'@typescript-eslint/no-require-imports': 'off',
// Disable rules that require strictNullChecks (tsconfig has strict: false)
'@typescript-eslint/prefer-nullish-coalescing': 'off',
// Allow any in union types (common in adapter interfaces)
'@typescript-eslint/no-redundant-type-constituents': 'off',
// Allow index signatures (common in dynamic interfaces)
'@typescript-eslint/consistent-indexed-object-style': 'off',
// Allow async functions without await (common in interface implementations)
'@typescript-eslint/require-await': 'off',
// Allow flexible generic constructors
'@typescript-eslint/consistent-generic-constructors': 'off',
},
},
);