Fix ESLint issues in TypeScript codebase
- Add browser globals for frontend TypeScript files in ESLint config - Fix unused parameter in MapImageService.generateErrorImage() - Remove auto-fixable formatting issues (trailing spaces, indentation) All ESLint errors now resolved, only warnings for 'any' types remain. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ab5cddeec5
commit
5a8bcb7fff
10 changed files with 83 additions and 48 deletions
|
@ -62,6 +62,41 @@ export default [
|
||||||
'no-trailing-spaces': 'error'
|
'no-trailing-spaces': 'error'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
files: ['src/frontend/**/*.ts'],
|
||||||
|
languageOptions: {
|
||||||
|
parser: typescriptParser,
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
sourceType: 'module'
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
...globals.browser
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
'@typescript-eslint': typescript
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
// TypeScript rules
|
||||||
|
'@typescript-eslint/no-unused-vars': 'error',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'warn',
|
||||||
|
|
||||||
|
// General rules
|
||||||
|
'no-console': 'off', // Allow console.log for debugging
|
||||||
|
'no-var': 'error',
|
||||||
|
'prefer-const': 'error',
|
||||||
|
'eqeqeq': 'error',
|
||||||
|
'no-unused-vars': 'off', // Use TypeScript version instead
|
||||||
|
|
||||||
|
// Style rules
|
||||||
|
'indent': ['error', 2],
|
||||||
|
'quotes': ['error', 'single'],
|
||||||
|
'semi': ['error', 'always'],
|
||||||
|
'comma-dangle': ['error', 'never'],
|
||||||
|
'no-trailing-spaces': 'error'
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['tests/**/*.ts'],
|
files: ['tests/**/*.ts'],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
|
|
|
@ -29,7 +29,7 @@ export class MapImageService {
|
||||||
return mapboxBuffer;
|
return mapboxBuffer;
|
||||||
} else {
|
} else {
|
||||||
// Return a simple error image if Mapbox fails
|
// Return a simple error image if Mapbox fails
|
||||||
return this.generateErrorImage(opts);
|
return this.generateErrorImage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ export class MapImageService {
|
||||||
/**
|
/**
|
||||||
* Generate a simple error image when Mapbox fails
|
* Generate a simple error image when Mapbox fails
|
||||||
*/
|
*/
|
||||||
private generateErrorImage(options: MapOptions): Buffer {
|
private generateErrorImage(): Buffer {
|
||||||
// Generate a simple 1x1 transparent PNG as fallback
|
// Generate a simple 1x1 transparent PNG as fallback
|
||||||
// This is a valid PNG header + IHDR + IDAT + IEND for a 1x1 transparent pixel
|
// This is a valid PNG header + IHDR + IDAT + IEND for a 1x1 transparent pixel
|
||||||
const transparentPng = Buffer.from([
|
const transparentPng = Buffer.from([
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue