diff --git a/eslint.config.js b/eslint.config.js index 3b3c3eb3d..e32e07c14 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,7 +2,6 @@ import markdown from 'eslint-plugin-markdown'; import globals from 'globals'; import n from 'eslint-plugin-n'; import svelteOrgEslintConfig from '@sveltejs/eslint-config'; -import svelteParser from 'svelte-eslint-parser'; export default [ { name: 'local/ignores', @@ -19,6 +18,17 @@ export default [ ] }, ...svelteOrgEslintConfig, // contains setup for svelte and typescript + { + name: 'local/typescript-parser-options', + files: ['docs/*.md/*.svelte'], + languageOptions: { + parserOptions: { + projectService: { + allowDefaultProject: ['docs/*.md/*.svelte'] + } + } + } + }, n.configs['flat/recommended-module'], ...markdown.configs.recommended, { @@ -120,13 +130,6 @@ export default [ 'prefer-const': 'off' // this turns let foo = $derived into a const otherwise } }, - { - name: 'local/svelte-runes-globals', - files: ['**/*.svelte.js', '**/*.svelte.ts', '**/*.svelte.*.js', '**/*.svelte.*.ts'], - languageOptions: { - parser: svelteParser - } - }, { name: 'local/markdown-codefences', files: ['**/*.md/*.js', '**/*.md/*.ts', '**/*.md/*.svelte'], diff --git a/package.json b/package.json index 4f74cebfd..6040c0b5e 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@eslint/eslintrc": "^3.3.0", "@eslint/js": "^9.21.0", "@stylistic/eslint-plugin-js": "^4.2.0", - "@sveltejs/eslint-config": "8.1.0", + "@sveltejs/eslint-config": "^8.2.0", "@svitejs/changesets-changelog-github-compact": "^1.2.0", "@types/fs-extra": "^11.0.4", "@types/node": "^22.13.9", @@ -38,7 +38,7 @@ "eslint-plugin-markdown": "^5.1.0", "eslint-plugin-n": "^17.16.2", "eslint-plugin-prettier": "^5.2.3", - "eslint-plugin-svelte": "^2.46.1", + "eslint-plugin-svelte": "^3.0.3", "execa": "^8.0.1", "fs-extra": "^11.3.0", "globals": "^15.15.0", diff --git a/packages/playground/big/jsconfig.json b/packages/playground/big/jsconfig.json new file mode 100644 index 000000000..31e2eea42 --- /dev/null +++ b/packages/playground/big/jsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "moduleResolution": "bundler", + "target": "ESNext", + "module": "ESNext", + /** + * svelte-preprocess cannot figure out whether you have + * a value or a type, so tell TypeScript to enforce using + * `import type` instead of `import` for Types. + */ + "verbatimModuleSyntax": true, + "isolatedModules": true, + "resolveJsonModule": true, + /** + * To have warnings / errors of the Svelte compiler at the + * correct position, enable source maps by default. + */ + "sourceMap": true, + "esModuleInterop": true, + "skipLibCheck": true, + /** + * Typecheck JS in `.svelte` and `.js` files by default. + * Disable this if you'd like to use dynamic types. + */ + "checkJs": true + }, + /** + * Use global.d.ts instead of compilerOptions.types + * to avoid limiting type declarations. + */ + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] +} diff --git a/packages/playground/big/src/App.svelte b/packages/playground/big/src/App.svelte index 15ac49204..686b5c336 100644 --- a/packages/playground/big/src/App.svelte +++ b/packages/playground/big/src/App.svelte @@ -13,7 +13,9 @@ diff --git a/packages/playground/kit-demo-app/src/routes/sverdle/+page.svelte b/packages/playground/kit-demo-app/src/routes/sverdle/+page.svelte index 8ed081b54..d02da613c 100644 --- a/packages/playground/kit-demo-app/src/routes/sverdle/+page.svelte +++ b/packages/playground/kit-demo-app/src/routes/sverdle/+page.svelte @@ -67,9 +67,11 @@ const key = /** @type {HTMLButtonElement} */ (event.target).getAttribute('data-key'); if (key === 'backspace') { + // eslint-disable-next-line svelte/no-reactive-reassign currentGuess = currentGuess.slice(0, -1); if (form?.badGuess) form.badGuess = false; } else if (currentGuess.length < 5) { + // eslint-disable-next-line svelte/no-reactive-reassign currentGuess += key; } } @@ -166,9 +168,9 @@ back - {#each ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'] as row} + {#each ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'] as row (row)}
- {#each row as letter} + {#each row as letter, index (index)}