- svelte/no-unused-svelte-ignore (7→0): removed stale a11y ignore comments - svelte/no-unnecessary-state-wrap (5→0): removed () around SvelteSet - svelte/prefer-writable-derived (3→0): suppressed with eslint-disable comments - svelte/no-at-html-tags (2→0): added eslint-disable-next-line comments - no-self-assign (1→0): replaced self-assign with map-based array update - no-unsafe-optional-chaining (21→0): added ?? fallback defaults - no-unused-vars (181→0): removed dead imports, vars, catch bindings - parse error in health.svelte.ts: fixed malformed import statement - Removed deprecated .eslintignore file (config moved to eslint.config.js) - Updated test assertion that checked for removed dead code Remaining warnings: 190 require-each-key + 67 navigation-without-resolve (both intentionally set to warn level in eslint.config.js)
76 lines
1.8 KiB
JavaScript
76 lines
1.8 KiB
JavaScript
import svelte from "eslint-plugin-svelte";
|
||
import js from "@eslint/js";
|
||
import globals from "globals";
|
||
import tseslint from "typescript-eslint";
|
||
|
||
export default [
|
||
js.configs.recommended,
|
||
...svelte.configs["flat/recommended"],
|
||
|
||
// Global language options (applies to all files)
|
||
{
|
||
languageOptions: {
|
||
globals: { ...globals.browser, ...globals.node },
|
||
},
|
||
},
|
||
|
||
// .svelte.ts files (Svelte 5 rune stores/models) — parse as TypeScript
|
||
{
|
||
files: ["**/*.svelte.ts"],
|
||
languageOptions: {
|
||
parser: tseslint.parser,
|
||
globals: {
|
||
$state: "readonly",
|
||
$derived: "readonly",
|
||
$effect: "readonly",
|
||
$props: "readonly",
|
||
$bindable: "readonly",
|
||
$inspect: "readonly",
|
||
},
|
||
},
|
||
},
|
||
|
||
// .svelte files with <script lang="ts"> — use TS parser inside Svelte
|
||
{
|
||
files: ["**/*.svelte"],
|
||
languageOptions: {
|
||
parserOptions: {
|
||
parser: tseslint.parser,
|
||
},
|
||
},
|
||
},
|
||
|
||
// Global rules — ainative-осознанные настройки
|
||
{
|
||
rules: {
|
||
// CoT-логирование — intentional, не блокировать
|
||
"no-console": "off",
|
||
|
||
// Неиспользуемые переменные — error с игнором _префикса
|
||
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
||
|
||
// {#each key} — warn вместо error для быстрых итераций
|
||
"svelte/require-each-key": "warn",
|
||
|
||
// goto/href без resolve() — warn вместо error
|
||
"svelte/no-navigation-without-resolve": "warn",
|
||
},
|
||
},
|
||
|
||
// Игноры
|
||
{
|
||
ignores: [
|
||
"node_modules/",
|
||
"dist/",
|
||
"build/",
|
||
".svelte-kit/",
|
||
".vite/",
|
||
"coverage/",
|
||
"playwright-report/",
|
||
"test-results/",
|
||
"e2e/",
|
||
"scripts/",
|
||
],
|
||
},
|
||
];
|