This repository was archived by the owner on Aug 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
136 lines (132 loc) · 4.08 KB
/
eslint.config.js
File metadata and controls
136 lines (132 loc) · 4.08 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import js from '@eslint/js';
import typescript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
export default [
js.configs.recommended,
{
files: ['src/**/*.ts', 'src/**/*.tsx'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
},
globals: {
// Browser globals
window: 'readonly',
document: 'readonly',
console: 'readonly',
navigator: 'readonly',
performance: 'readonly',
requestAnimationFrame: 'readonly',
cancelAnimationFrame: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly',
alert: 'readonly',
confirm: 'readonly',
prompt: 'readonly',
fetch: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
AbortController: 'readonly',
screen: 'readonly',
crypto: 'readonly',
// Node.js globals for build tools
require: 'readonly',
NodeJS: 'readonly',
// Web Workers
self: 'readonly',
importScripts: 'readonly',
postMessage: 'readonly',
},
},
plugins: {
'@typescript-eslint': typescript,
},
rules: {
// TypeScript specific rules
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
], // Allow underscore-prefixed unused vars
'@typescript-eslint/no-explicit-any': 'off', // Disabled for now
'@typescript-eslint/explicit-function-return-type': 'off',
'@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',
// General JavaScript rules
'no-console': 'off', // Allow console for debugging
'no-debugger': 'error',
'no-duplicate-imports': 'warn', // Changed from error to warn
'no-unused-expressions': 'error',
'prefer-const': 'error',
'no-var': 'error',
'prefer-template': 'warn', // Changed from error
'object-shorthand': 'warn', // Changed from error
'prefer-arrow-callback': 'warn', // Changed from error
'no-unused-vars': 'off', // Let TypeScript handle this
'no-redeclare': 'warn', // Changed from error
'no-case-declarations': 'warn', // Changed from error
// Code complexity rules - very relaxed for now
complexity: 'off', // Disabled
'max-depth': 'off', // Disabled
'max-lines-per-function': 'off', // Disabled
'max-params': 'off', // Disabled
// Best practices
eqeqeq: ['error', 'always'],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-new-func': 'error',
'no-return-await': 'error',
'prefer-promise-reject-errors': 'error',
},
},
{
files: ['scripts/**/*.js', 'scripts/**/*.mjs', 'scripts/**/*.cjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module', // ES modules for .mjs files
globals: {
// Node.js globals
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'readonly',
console: 'readonly',
},
},
rules: {
'no-console': 'off',
'no-unused-vars': 'warn',
},
},
{
ignores: [
'dist/**',
'coverage/**',
'node_modules/**',
'public/**',
'src/main-backup.ts',
'src/main-leaderboard.ts',
'src/core/simulation_clean.ts',
'src/core/simulation_final.ts',
'src/core/simulation_minimal.ts',
'src/core/simulation_simple.ts',
'src/examples/interactive-examples.ts',
],
},
];