chore: update ESLint to v10 (#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>
pull/17650/merge
Rich Harris 7 months ago committed by GitHub
parent 15fe6b85c0
commit e3d7f3986f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -86,7 +86,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: 18
node-version: 24
cache: pnpm
- name: install
run: pnpm install --frozen-lockfile

@ -33,7 +33,7 @@ const no_compiler_imports = {
}
};
/** @type {import('eslint').Linter.FlatConfig[]} */
/** @type {import('eslint').Linter.Config[]} */
export default [
...svelte_config,
{

@ -27,22 +27,30 @@
},
"devDependencies": {
"@changesets/cli": "^2.29.8",
"@sveltejs/eslint-config": "^8.3.3",
"@sveltejs/eslint-config": "^8.3.5",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@types/node": "^20.11.5",
"@types/picomatch": "^4.0.2",
"@vitest/coverage-v8": "^2.1.9",
"eslint": "^9.9.1",
"eslint-plugin-lube": "^0.4.3",
"eslint-plugin-svelte": "^3.11.0",
"@eslint/js": "^10.0.0",
"eslint": "^10.0.0",
"eslint-plugin-lube": "^0.5.1",
"eslint-plugin-svelte": "^3.15.0",
"jsdom": "25.0.1",
"playwright": "^1.58.0",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.4.0",
"svelte": "workspace:^",
"typescript": "^5.5.4",
"typescript-eslint": "^8.48.1",
"typescript-eslint": "^8.55.0",
"v8-natives": "^1.2.5",
"vitest": "^2.1.9"
},
"pnpm": {
"peerDependencyRules": {
"allowedVersions": {
"eslint": "10"
}
}
}
}

@ -46,10 +46,11 @@ function levenshtein(str1, str2) {
/** @type {number[]} */
const current = [];
let prev = 0;
let value = 0;
for (let i = 0; i <= str2.length; i++) {
for (let j = 0; j <= str1.length; j++) {
let value;
if (i && j) {
if (str1.charAt(j - 1) === str2.charAt(i - 1)) {
value = prev;

@ -538,7 +538,7 @@ function build_attr_style(style_directives, expression, context, transform) {
name = name.toLowerCase();
}
const property = b.init(directive.name, expression);
const property = b.init(name, expression);
if (directive.modifiers.includes('important')) {
important_properties.push(property);
} else {

@ -126,7 +126,7 @@ export function proxy(value) {
}
var s = sources.get(prop);
if (s === undefined) {
s = with_parent(() => {
with_parent(() => {
var s = source(descriptor.value, stack);
sources.set(prop, s);
if (DEV && typeof prop === 'string') {

@ -302,6 +302,7 @@ export function update_pre(source, d = 1) {
var value = get(source);
// @ts-expect-error
// eslint-disable-next-line no-useless-assignment -- `++`/`--` used for return value, not side effect on `value`
return set(source, d === 1 ? ++value : --value);
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save