File tree Expand file tree Collapse file tree 14 files changed +182
-0
lines changed Expand file tree Collapse file tree 14 files changed +182
-0
lines changed Original file line number Diff line number Diff line change
1
+ svelte.config.js
2
+ vite.config.ts
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ // ...
3
+ extends : [ "plugin:svelte/recommended" , "plugin:@typescript-eslint/recommended" ] ,
4
+ // ...
5
+ parser : "@typescript-eslint/parser" ,
6
+ parserOptions : {
7
+ // ...
8
+ project : "tsconfig.json" ,
9
+ extraFileExtensions : [ ".svelte" ] , // This is a required setting in `@typescript-eslint/parser` v4.24.0.
10
+ } ,
11
+ rules :{
12
+ "@typescript-eslint/no-unsafe-member-access" : "error"
13
+ } ,
14
+ overrides : [
15
+ {
16
+ files : [ "*.svelte" ] ,
17
+ parser : "svelte-eslint-parser" ,
18
+ parserOptions : {
19
+ parser : "@typescript-eslint/parser" ,
20
+ } ,
21
+ } ,
22
+ // ...
23
+ ] ,
24
+ // ...
25
+ }
Original file line number Diff line number Diff line change
1
+ .DS_Store
2
+ node_modules
3
+ /build
4
+ /.svelte-kit
5
+ /package
6
+ .env
7
+ .env. *
8
+ ! .env.example
9
+ vite.config.js.timestamp- *
10
+ vite.config.ts.timestamp- *
Original file line number Diff line number Diff line change
1
+ engine-strict = true
Original file line number Diff line number Diff line change
1
+ # create-svelte
2
+
3
+ Everything you need to build a Svelte project, powered by [ ` create-svelte ` ] ( https://github.com/sveltejs/kit/tree/master/packages/create-svelte ) .
4
+
5
+ ## Creating a project
6
+
7
+ If you're seeing this, you've probably already done this step. Congrats!
8
+
9
+ ``` bash
10
+ # create a new project in the current directory
11
+ npm create svelte@latest
12
+
13
+ # create a new project in my-app
14
+ npm create svelte@latest my-app
15
+ ```
16
+
17
+ ## Developing
18
+
19
+ Once you've created a project and installed dependencies with ` npm install ` (or ` pnpm install ` or ` yarn ` ), start a development server:
20
+
21
+ ``` bash
22
+ npm run dev
23
+
24
+ # or start the server and open the app in a new browser tab
25
+ npm run dev -- --open
26
+ ```
27
+
28
+ ## Building
29
+
30
+ To create a production version of your app:
31
+
32
+ ``` bash
33
+ npm run build
34
+ ```
35
+
36
+ You can preview the production build with ` npm run preview ` .
37
+
38
+ > To deploy your app, you may need to install an [ adapter] ( https://kit.svelte.dev/docs/adapters ) for your target environment.
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " my-app2" ,
3
+ "version" : " 0.0.1" ,
4
+ "private" : true ,
5
+ "scripts" : {
6
+ "dev" : " vite dev" ,
7
+ "build" : " vite build" ,
8
+ "preview" : " vite preview" ,
9
+ "check" : " svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" ,
10
+ "check:watch" : " svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
11
+ },
12
+ "devDependencies" : {
13
+ "@sveltejs/adapter-auto" : " ^2.0.0" ,
14
+ "@sveltejs/kit" : " ^1.5.0" ,
15
+ "@typescript-eslint/eslint-plugin" : " ^5.57.0" ,
16
+ "@typescript-eslint/parser" : " ^5.57.0" ,
17
+ "svelte" : " ^3.54.0" ,
18
+ "svelte-check" : " ^3.0.1" ,
19
+ "tslib" : " ^2.4.1" ,
20
+ "typescript" : " ^5.0.0" ,
21
+ "vite" : " ^4.2.0"
22
+ },
23
+ "type" : " module" ,
24
+ "dependencies" : {
25
+ "eslint" : " ^8.37.0" ,
26
+ "eslint-plugin-svelte" : " ^2.25.0"
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ // See https://kit.svelte.dev/docs/types#app
2
+ // for information about these interfaces
3
+ declare global {
4
+ namespace App {
5
+ // interface Error {}
6
+ // interface Locals {}
7
+ // interface PageData {}
8
+ // interface Platform {}
9
+ }
10
+ }
11
+
12
+ export { } ;
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < link rel ="icon " href ="%sveltekit.assets%/favicon.png " />
6
+ < meta name ="viewport " content ="width=device-width " />
7
+ %sveltekit.head%
8
+ </ head >
9
+ < body data-sveltekit-preload-data ="hover ">
10
+ < div style ="display: contents "> %sveltekit.body%</ div >
11
+ </ body >
12
+ </ html >
Original file line number Diff line number Diff line change
1
+ <script lang =" ts" strictEvents >
2
+ import { createEventDispatcher } from ' svelte'
3
+
4
+ const dispatch = createEventDispatcher <{ value: number }>()
5
+ dispatch (' value' , 1 )
6
+ </script >
7
+
Original file line number Diff line number Diff line change
1
+ <script lang =" ts" strictEvents >
2
+ import Asdf from ' ./asdf.svelte'
3
+ </script >
4
+
5
+ <Asdf
6
+ on:value ={(e ) => {
7
+ e .detail .toString ()
8
+ }}
9
+ />
Original file line number Diff line number Diff line change
1
+ import adapter from '@sveltejs/adapter-auto' ;
2
+ import { vitePreprocess } from '@sveltejs/kit/vite' ;
3
+
4
+ /** @type {import('@sveltejs/kit').Config } */
5
+ const config = {
6
+ // Consult https://kit.svelte.dev/docs/integrations#preprocessors
7
+ // for more information about preprocessors
8
+ preprocess : vitePreprocess ( ) ,
9
+
10
+ kit : {
11
+ // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
12
+ // If your environment is not supported or you settled on a specific environment, switch out the adapter.
13
+ // See https://kit.svelte.dev/docs/adapters for more information about adapters.
14
+ adapter : adapter ( )
15
+ }
16
+ } ;
17
+
18
+ export default config ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ./.svelte-kit/tsconfig.json" ,
3
+ "compilerOptions" : {
4
+ "allowJs" : true ,
5
+ "checkJs" : true ,
6
+ "esModuleInterop" : true ,
7
+ "forceConsistentCasingInFileNames" : true ,
8
+ "resolveJsonModule" : true ,
9
+ "skipLibCheck" : true ,
10
+ "sourceMap" : true ,
11
+ "strict" : true
12
+ },
13
+ "include" : [" src" ]
14
+ }
Original file line number Diff line number Diff line change
1
+ import { sveltekit } from '@sveltejs/kit/vite' ;
2
+ import { defineConfig } from 'vite' ;
3
+
4
+ export default defineConfig ( {
5
+ plugins : [ sveltekit ( ) ]
6
+ } ) ;
You can’t perform that action at this time.
0 commit comments