Skip to content

Commit dcae38b

Browse files
committed
Migrate to kit@2
1 parent 5e7c96f commit dcae38b

File tree

7 files changed

+29
-34
lines changed

7 files changed

+29
-34
lines changed

.eslintrc.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
/** @type { import("eslint").Linter.Config } */
12
module.exports = {
23
root: true,
3-
extends: ['eslint:recommended', 'prettier'],
4-
plugins: ['svelte3'],
5-
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
4+
extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'],
65
parserOptions: {
76
sourceType: 'module',
8-
ecmaVersion: 2020
7+
ecmaVersion: 2020,
8+
extraFileExtensions: ['.svelte']
99
},
1010
env: {
1111
browser: true,

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"trailingComma": "none",
55
"printWidth": 100,
66
"plugins": ["prettier-plugin-svelte"],
7-
"pluginSearchDirs": ["."],
87
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
98
"semi": false,
109
"proseWrap": "always",

jsconfig.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
{
22
"extends": "./.svelte-kit/tsconfig.json",
33
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": true,
64
"esModuleInterop": true,
75
"forceConsistentCasingInFileNames": true,
86
"resolveJsonModule": true,
97
"skipLibCheck": true,
108
"sourceMap": true,
11-
"strict": true
9+
"module": "NodeNext",
10+
"moduleResolution": "NodeNext"
1211
}
13-
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
14-
//
15-
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16-
// from the referenced tsconfig.json - TypeScript does not merge them in
1712
}

playwright.config.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { defineConfig } from '@playwright/test'
2-
3-
export default defineConfig({
4-
testDir: 'tests',
5-
testMatch: '**/*.js',
1+
/** @type {import('@playwright/test').PlaywrightTestConfig} */
2+
const config = {
63
use: {
74
baseURL: 'http://localhost:5173'
85
},
96
webServer: {
107
command: 'npm run dev',
118
url: 'http://localhost:5173',
129
reuseExistingServer: true
13-
}
14-
})
10+
},
11+
testDir: 'tests',
12+
testMatch: /(.+\.)?(test|spec)\.[jt]s/
13+
}
14+
15+
export default config

src/app.d.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
/// <reference types="@sveltejs/kit" />
2-
31
// See https://kit.svelte.dev/docs/types#app
42
// for information about these interfaces
5-
// and what to do when importing types
6-
declare namespace App {
7-
// interface Error {}
8-
// interface Locals {}
9-
// interface PageData {}
10-
// interface Platform {}
3+
declare global {
4+
namespace App {
5+
// interface Error {}
6+
// interface Locals {}
7+
// interface PageData {}
8+
// interface PageState {}
9+
// interface Platform {}
10+
}
1111
}
12+
13+
export {}

src/app.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
55
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
%sveltekit.head%
88
</head>
9-
<body>
9+
<body data-sveltekit-preload-data="hover">
1010
<div>%sveltekit.body%</div>
1111
</body>
1212
</html>

vite.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { sveltekit } from '@sveltejs/kit/vite'
2+
import { defineConfig } from 'vite'
23

3-
/** @type {import('vite').UserConfig} */
4-
const config = {
4+
export default defineConfig({
55
plugins: [sveltekit()]
6-
}
7-
8-
export default config
6+
})

0 commit comments

Comments
 (0)