-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy patheslint.config.js
More file actions
67 lines (64 loc) · 1.83 KB
/
Copy patheslint.config.js
File metadata and controls
67 lines (64 loc) · 1.83 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import compat from 'eslint-plugin-compat';
import json from 'eslint-plugin-json';
import prettier from 'eslint-plugin-prettier';
export default [
// Base configuration
js.configs.recommended,
...tseslint.configs.recommended,
compat.configs['flat/recommended'],
json.configs.recommended,
{
files: ['src/**/*.ts'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: tseslint.parser,
parserOptions: {
projectService: true
}
},
plugins: {
prettier: prettier
},
rules: {
'no-unused-private-class-members': 'off',
'no-prototype-builtins': 'off',
'default-case': 'error',
eqeqeq: 'error',
'guard-for-in': 'error',
'no-self-compare': 'error',
'no-void': 'error',
radix: 'error',
'wrap-iife': ['error', 'inside'],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' }
],
// Allow short-circuit expressions (e.g., `expr && fn()`) — common pattern in this codebase
'@typescript-eslint/no-unused-expressions': [
'error',
{ allowShortCircuit: true }
],
// Allow `const self = this` pattern (used in PacketLossEngine's IIFE)
'@typescript-eslint/no-this-alias': 'off',
// Enforce `import type` for type-only imports (helps tree-shaking and clarity)
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }
],
'prettier/prettier': 'error'
},
settings: {
polyfills: [
'Array.prototype.includes',
'Promise',
'fetch',
'URL',
'URLSearchParams'
]
}
}
];