Skip to content

Commit e3d7f39

Browse files
Rich-Harrisclaude
andauthored
chore: update ESLint to v10 (sveltejs#17670)
* chore: update ESLint to v10 Update eslint and related plugins/configs. Bump CI lint job to Node 24 (ESLint 10 requires ^20.19.0 || ^22.13.0 || >=24). Replace removed Linter.FlatConfig type with Linter.Config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address new `no-useless-assignment` violations from ESLint 10 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * dedupe --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 15fe6b8 commit e3d7f39

File tree

8 files changed

+294
-282
lines changed

8 files changed

+294
-282
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- uses: pnpm/action-setup@v4
8787
- uses: actions/setup-node@v6
8888
with:
89-
node-version: 18
89+
node-version: 24
9090
cache: pnpm
9191
- name: install
9292
run: pnpm install --frozen-lockfile

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const no_compiler_imports = {
3333
}
3434
};
3535

36-
/** @type {import('eslint').Linter.FlatConfig[]} */
36+
/** @type {import('eslint').Linter.Config[]} */
3737
export default [
3838
...svelte_config,
3939
{

package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,30 @@
2727
},
2828
"devDependencies": {
2929
"@changesets/cli": "^2.29.8",
30-
"@sveltejs/eslint-config": "^8.3.3",
30+
"@sveltejs/eslint-config": "^8.3.5",
3131
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
3232
"@types/node": "^20.11.5",
3333
"@types/picomatch": "^4.0.2",
3434
"@vitest/coverage-v8": "^2.1.9",
35-
"eslint": "^9.9.1",
36-
"eslint-plugin-lube": "^0.4.3",
37-
"eslint-plugin-svelte": "^3.11.0",
35+
"@eslint/js": "^10.0.0",
36+
"eslint": "^10.0.0",
37+
"eslint-plugin-lube": "^0.5.1",
38+
"eslint-plugin-svelte": "^3.15.0",
3839
"jsdom": "25.0.1",
3940
"playwright": "^1.58.0",
4041
"prettier": "^3.2.4",
4142
"prettier-plugin-svelte": "^3.4.0",
4243
"svelte": "workspace:^",
4344
"typescript": "^5.5.4",
44-
"typescript-eslint": "^8.48.1",
45+
"typescript-eslint": "^8.55.0",
4546
"v8-natives": "^1.2.5",
4647
"vitest": "^2.1.9"
48+
},
49+
"pnpm": {
50+
"peerDependencyRules": {
51+
"allowedVersions": {
52+
"eslint": "10"
53+
}
54+
}
4755
}
4856
}

packages/svelte/src/compiler/phases/1-parse/utils/fuzzymatch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ function levenshtein(str1, str2) {
4646
/** @type {number[]} */
4747
const current = [];
4848
let prev = 0;
49-
let value = 0;
5049

5150
for (let i = 0; i <= str2.length; i++) {
5251
for (let j = 0; j <= str1.length; j++) {
52+
let value;
53+
5354
if (i && j) {
5455
if (str1.charAt(j - 1) === str2.charAt(i - 1)) {
5556
value = prev;

packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ function build_attr_style(style_directives, expression, context, transform) {
538538
name = name.toLowerCase();
539539
}
540540

541-
const property = b.init(directive.name, expression);
541+
const property = b.init(name, expression);
542542
if (directive.modifiers.includes('important')) {
543543
important_properties.push(property);
544544
} else {

packages/svelte/src/internal/client/proxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function proxy(value) {
126126
}
127127
var s = sources.get(prop);
128128
if (s === undefined) {
129-
s = with_parent(() => {
129+
with_parent(() => {
130130
var s = source(descriptor.value, stack);
131131
sources.set(prop, s);
132132
if (DEV && typeof prop === 'string') {

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ export function update_pre(source, d = 1) {
302302
var value = get(source);
303303

304304
// @ts-expect-error
305+
// eslint-disable-next-line no-useless-assignment -- `++`/`--` used for return value, not side effect on `value`
305306
return set(source, d === 1 ? ++value : --value);
306307
}
307308

0 commit comments

Comments
 (0)