Skip to content

Commit

Permalink
chore: update eslint-plugin-svelte to v3 (#1095)
Browse files Browse the repository at this point in the history
* chore: update eslint-plugin-svelte

* fix: lint docs/**/*.svelte
  • Loading branch information
baseballyama authored Mar 5, 2025
1 parent 1644cd4 commit e75a776
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 40 deletions.
19 changes: 11 additions & 8 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
{
Expand Down Expand Up @@ -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'],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.ghproxy.toppact": "^1.2.0",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.13.9",
Expand All @@ -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",
Expand Down
32 changes: 32 additions & 0 deletions packages/playground/big/jsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
4 changes: 3 additions & 1 deletion packages/playground/big/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<nav>
<h2>This is a huge app</h2>
{#each Object.entries(pages) as [name, cmp] (cmp)}
<a class="App-link" href on:click|preventDefault={go(cmp)}>{name.replace('_', ' ')}</a>
<a class="App-link" href={`?page=${name}`} on:click|preventDefault={go(cmp)}
>{name.replace('_', ' ')}</a
>
{/each}
</nav>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -166,9 +168,9 @@
back
</button>
{#each ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'] as row}
{#each ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'] as row (row)}
<div class="row">
{#each row as letter}
{#each row as letter, index (index)}
<button
on:click|preventDefault={update}
data-key={letter}
Expand Down
84 changes: 57 additions & 27 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e75a776

Please sign in to comment.