Skip to content

Commit 298b476

Browse files
committed
fix: resolve ESLint configuration and linting errors
- Fix ESLint extends syntax to use 'plugin:@typescript-eslint/recommended' - Add argsIgnorePattern to ignore unused parameters starting with underscore - Fix no-case-declarations errors by wrapping case blocks in braces - Auto-fix prefer-const issues in UrlProcessor.ts - All linting errors resolved, only warnings remain
1 parent 71b0f38 commit 298b476

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

mobile/lib/providers/server_status_provider.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ class ServerStatusProvider with ChangeNotifier {
106106

107107
bool _shouldSkipHealthCheck() {
108108
if (_consecutiveFailures == 0) return false;
109-
109+
110110
final now = DateTime.now();
111111
if (_lastFailureTime == null) return false;
112-
112+
113113
// Calculate exponential backoff delay: 2^failures seconds, max 300 seconds (5 minutes)
114114
final delaySeconds = (1 << _consecutiveFailures).clamp(1, 300);
115115
final timeSinceLastFailure = now.difference(_lastFailureTime!).inSeconds;
116-
116+
117117
return timeSinceLastFailure < delaySeconds;
118118
}
119119

server/.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module.exports = {
22
parser: "@typescript-eslint/parser",
3-
extends: ["eslint:recommended", "@typescript-eslint/recommended"],
3+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
44
plugins: ["@typescript-eslint"],
55
parserOptions: {
66
ecmaVersion: 2020,
77
sourceType: "module",
88
},
99
rules: {
10-
"@typescript-eslint/no-unused-vars": "error",
10+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
1111
"@typescript-eslint/no-explicit-any": "warn",
1212
"@typescript-eslint/explicit-function-return-type": "off",
1313
"@typescript-eslint/explicit-module-boundary-types": "off",

server/src/engine/StrategyEngine.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export class StrategyEngine {
2222
async cleanup(): Promise<void> {
2323
// Wait for any pending operations to complete
2424
await new Promise(resolve => setImmediate(resolve));
25-
25+
2626
// Clean up redirect resolver
2727
if (this.redirectResolver && typeof this.redirectResolver.cleanup === 'function') {
2828
await this.redirectResolver.cleanup();
2929
}
30-
30+
3131
// Clean up generic strategy
3232
if (this.genericStrategy && typeof this.genericStrategy.cleanup === 'function') {
3333
await this.genericStrategy.cleanup();
@@ -369,15 +369,17 @@ export class StrategyEngine {
369369
if (domain.toLowerCase() === matcher.pattern.toLowerCase()) return true;
370370
}
371371
break;
372-
case 'wildcard':
372+
case 'wildcard': {
373373
const pattern = matcher.pattern.replace(/\*/g, '.*');
374374
const regex = new RegExp(`^${pattern}$`, matcher.caseSensitive ? '' : 'i');
375375
if (regex.test(domain)) return true;
376376
break;
377-
case 'regex':
377+
}
378+
case 'regex': {
378379
const regexPattern = new RegExp(matcher.pattern, matcher.caseSensitive ? '' : 'i');
379380
if (regexPattern.test(domain)) return true;
380381
break;
382+
}
381383
}
382384
}
383385
return false;

server/src/engine/UrlProcessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { URL } from 'url';
33

44
export class UrlProcessor {
55
process(url: string, strategy: Strategy): string {
6-
let processedUrl = url;
6+
const processedUrl = url;
77
console.log(`[Processor] START url=${url} strategy=${strategy.id}`);
88
const urlObj = new URL(processedUrl);
99

0 commit comments

Comments
 (0)