Files
trips/eslint.config.js

42 lines
1.2 KiB
JavaScript

import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
{
languageOptions: {
globals: { ...globals.browser, ...globals.node }
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: { parser: ts.parser }
}
},
{
rules: {
// The `search;` pattern is intentional for Svelte 5 $effect reactivity tracking
'@typescript-eslint/no-unused-expressions': 'off',
// {@html} is used for inline SVG icons where content is hardcoded and safe
'svelte/no-at-html-tags': 'off',
// Plain <a href> links don't need SvelteKit's resolve() — only programmatic goto() does
'svelte/no-navigation-without-resolve': 'off',
// Demote to warning so {#each} without key is flagged but doesn't block CI
'svelte/require-each-key': 'warn',
// Allow intentional unused vars prefixed with _ (catch-block placeholders etc.)
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }
]
}
},
{
ignores: ['.svelte-kit/', 'build/', 'node_modules/']
}
];