Skip to content

Commit 33f8808

Browse files
authored
refactor: migrate to Svelte v5
- upgrade dependencies - `@ui5/webcomponents: 2.16.0` - `svelte: 5.43.1` - migrate to Svelte v5 syntax - upgraded eslint to v9.x - refactored code for fixing DRY and improve readability - refactored [deprecated event dispatch usage](https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events)
2 parents 273fb37 + 348546b commit 33f8808

21 files changed

+7177
-10054
lines changed

.eslintignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Node.js environment
2020
uses: actions/setup-node@v2.4.1
2121
with:
22-
node-version: 16.x
22+
node-version: 22.x
2323
- name: Install and Build
2424
run: |
2525
npm install

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 16
14+
node-version: 22
1515
cache: "npm"
1616

1717
- name: Build

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Node.js environment
2020
uses: actions/setup-node@v2.4.1
2121
with:
22-
node-version: 16.x
22+
node-version: 22.x
2323
- name: Install and Lint
2424
run: |
2525
npm install

.husky/pre-push

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npm run hooks:pre-push

eslint.config.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// eslint.config.js
2+
import js from "@eslint/js";
3+
import svelte from "eslint-plugin-svelte";
4+
import globals from "globals";
5+
import ts from "typescript-eslint";
6+
import svelteConfig from "./svelte.config.js";
7+
import { defineConfig } from "eslint/config";
8+
9+
export default defineConfig(
10+
js.configs.recommended,
11+
...ts.configs.recommended,
12+
...svelte.configs.recommended,
13+
{
14+
languageOptions: {
15+
globals: {
16+
...globals.browser,
17+
...globals.node,
18+
},
19+
},
20+
},
21+
{
22+
files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
23+
// See more details at: https://typescript-eslint.io/packages/parser/
24+
languageOptions: {
25+
parserOptions: {
26+
projectService: true,
27+
extraFileExtensions: [".svelte"], // Add support for additional file extensions, such as .svelte
28+
parser: ts.parser,
29+
// Specify a parser for each language, if needed:
30+
// parser: {
31+
// ts: ts.parser,
32+
// js: espree, // Use espree for .js files (add: import espree from 'espree')
33+
// typescript: ts.parser
34+
// },
35+
36+
// We recommend importing and specifying svelte.config.js.
37+
// By doing so, some rules in eslint-plugin-svelte will automatically read the configuration and adjust their behavior accordingly.
38+
// While certain Svelte settings may be statically loaded from svelte.config.js even if you don’t specify it,
39+
// explicitly specifying it ensures better compatibility and functionality.
40+
svelteConfig,
41+
},
42+
},
43+
},
44+
{
45+
rules: {
46+
// Override or add rule settings here, such as:
47+
// 'svelte/rule-name': 'error'
48+
},
49+
},
50+
{
51+
ignores: ["node_modules/**", "dist/**", "build/**"],
52+
},
53+
);

0 commit comments

Comments
 (0)