- Add explicit latitude/longitude validation in location submissions - Implement ESLint with TypeScript support and flat config - Auto-fix 621 formatting issues across codebase - Add comprehensive tests for coordinate validation - Update documentation with lint scripts and validation rules - Maintain 128 passing tests with enhanced security 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
No EOL
1.8 KiB
JavaScript
77 lines
No EOL
1.8 KiB
JavaScript
import js from '@eslint/js';
|
|
import typescript from '@typescript-eslint/eslint-plugin';
|
|
import typescriptParser from '@typescript-eslint/parser';
|
|
import globals from 'globals';
|
|
|
|
export default [
|
|
{
|
|
ignores: ['node_modules/', 'dist/', 'public/*.css', '*.db', '*.scss', '*.md']
|
|
},
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.ts'],
|
|
languageOptions: {
|
|
parser: typescriptParser,
|
|
parserOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'module'
|
|
},
|
|
globals: {
|
|
...globals.node
|
|
}
|
|
},
|
|
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 server logging
|
|
'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: ['**/*.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node
|
|
}
|
|
},
|
|
rules: {
|
|
'no-console': 'off',
|
|
'no-var': 'error',
|
|
'prefer-const': 'error',
|
|
'eqeqeq': 'error',
|
|
'indent': ['error', 2],
|
|
'quotes': ['error', 'single'],
|
|
'semi': ['error', 'always'],
|
|
'comma-dangle': ['error', 'never'],
|
|
'no-trailing-spaces': 'error'
|
|
}
|
|
},
|
|
{
|
|
files: ['tests/**/*.ts'],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
...globals.jest
|
|
}
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'off' // Allow any in tests for mocks
|
|
}
|
|
}
|
|
]; |