-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.mjs
More file actions
105 lines (90 loc) · 3.86 KB
/
eslint.config.mjs
File metadata and controls
105 lines (90 loc) · 3.86 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
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
export default [
js.configs.recommended,
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
...globals.node,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
},
rules: {
// TypeScript recommended rules
...tsPlugin.configs.recommended.rules,
// Single quotes with avoid-escape (matching TSLint quotemark)
// Allow template literals as they're commonly used in the codebase
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
// Max line length 120 with ignore patterns for imports/exports
'max-len': ['error', {
code: 120,
ignorePattern: '^import |^export \\{(.*?)\\}|class [a-zA-Z]+ implements |//',
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
// Trailing commas - disabled to match existing codebase style
'comma-dangle': 'off',
// Disabled rules (matching TSLint config)
'no-empty': 'off',
'no-console': 'off',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
// Allow unused vars/params - matching TSLint which didn't enforce this strictly
'@typescript-eslint/no-unused-vars': 'off',
// Other disabled TypeScript rules
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
// Disable rules that TypeScript handles
'no-undef': 'off',
'no-redeclare': 'off',
// Semicolons - disabled to match existing codebase style
semi: 'off',
// Disable multiline check - TypeScript handles this
'no-unexpected-multiline': 'off',
// Disallow multiple spaces
'no-multi-spaces': 'error',
// Whitespace rules
'no-trailing-spaces': 'error',
'eol-last': ['error', 'always'],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
// Spacing rules
'keyword-spacing': ['error', { before: true, after: true }],
'space-before-blocks': 'error',
'space-infix-ops': 'error',
'comma-spacing': ['error', { before: false, after: true }],
'semi-spacing': ['error', { before: false, after: true }],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
// Brace and block style
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'curly': ['error', 'all'],
// Other common rules
'arrow-spacing': ['error', { before: true, after: true }],
'template-curly-spacing': ['error', 'never'],
'rest-spread-spacing': ['error', 'never'],
'prefer-const': 'error',
'no-var': 'error',
'eqeqeq': ['error', 'always'],
},
},
{
ignores: ['dist/**', 'node_modules/**'],
},
];