2026-06-17 17:06:30 -06:00
|
|
|
import js from '@eslint/js';
|
|
|
|
|
import svelte from 'eslint-plugin-svelte';
|
|
|
|
|
import prettier from 'eslint-config-prettier';
|
|
|
|
|
import globals from 'globals';
|
|
|
|
|
import ts from 'typescript-eslint';
|
|
|
|
|
|
|
|
|
|
export default ts.config(
|
|
|
|
|
js.configs.recommended,
|
|
|
|
|
...ts.configs.recommended,
|
|
|
|
|
...svelte.configs['flat/recommended'],
|
|
|
|
|
prettier,
|
|
|
|
|
...svelte.configs['flat/prettier'],
|
|
|
|
|
{
|
|
|
|
|
languageOptions: {
|
|
|
|
|
globals: {
|
|
|
|
|
...globals.browser,
|
|
|
|
|
...globals.node
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-06-21 19:03:07 +02:00
|
|
|
// `.svelte` components and `.svelte.ts`/`.svelte.js` rune modules are all
|
|
|
|
|
// parsed by svelte-eslint-parser under eslint-plugin-svelte v3; it needs the
|
|
|
|
|
// TS parser for the embedded/whole-file TypeScript or it chokes on type syntax.
|
|
|
|
|
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
|
2026-06-17 17:06:30 -06:00
|
|
|
languageOptions: {
|
|
|
|
|
parserOptions: {
|
|
|
|
|
parser: ts.parser
|
|
|
|
|
}
|
2026-06-19 14:00:56 +00:00
|
|
|
},
|
|
|
|
|
// TypeScript + svelte-check already resolve identifiers (including `<script
|
|
|
|
|
// generics>` type params, which core `no-undef` can't see). Defer to them.
|
|
|
|
|
rules: {
|
|
|
|
|
'no-undef': 'off'
|
2026-06-17 17:06:30 -06:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-06-17 22:07:18 -06:00
|
|
|
// `static/` holds vendored, verbatim assets (the delta-upload worker and
|
|
|
|
|
// the wasm-bindgen hash glue) — lint them as the upstream ships them.
|
2026-06-19 14:00:56 +00:00
|
|
|
ignores: ['build/', '.svelte-kit/', 'package/', 'static/', 'bench/']
|
2026-06-17 17:06:30 -06:00
|
|
|
}
|
|
|
|
|
);
|