-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
56 lines (48 loc) · 1.39 KB
/
eslint.config.js
File metadata and controls
56 lines (48 loc) · 1.39 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-config-prettier';
export default tseslint.config(
// Ignore patterns
{
ignores: ['dist/', 'node_modules/', 'coverage/', '*.config.ts', '*.config.js'],
},
// Base JavaScript rules
js.configs.recommended,
// TypeScript-ESLint recommended rules
...tseslint.configs.recommended,
// Prettier config to disable conflicting rules
prettierConfig,
// Custom configuration for all TypeScript files
{
files: ['**/*.ts'],
languageOptions: {
parserOptions: {
project: './tsconfig.json',
},
},
rules: {
// TypeScript-specific rules
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'error',
// General code quality
'no-console': 'warn',
'prefer-const': 'error',
},
},
// Test file specific rules
{
files: ['test/**/*.ts'],
rules: {
'no-console': 'off', // Allow console in tests
},
},
// Example file specific rules
{
files: ['examples/**/*.ts'],
rules: {
'no-console': 'off', // Allow console in examples (for demonstration output)
'@typescript-eslint/no-unused-vars': 'off', // Allow unused vars in examples (demonstration code)
},
}
);