Skip to content

Commit 9fb0ca4

Browse files
committed
set tabs=false in .prettierrc. npm run format
1 parent de5e120 commit 9fb0ca4

29 files changed

+444
-448
lines changed

.devcontainer/devcontainer.json

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"name": "Svelte-Static",
3-
"dockerComposeFile": "./docker-compose.yml",
4-
"service": "svelte-static",
5-
"remoteUser": "developer",
6-
"workspaceFolder": "/svelte-static",
7-
"postCreateCommand": ".devcontainer/post-create.sh",
8-
"customizations": {
9-
"vscode": {
10-
"extensions": [
11-
"ms-vscode.vscode-typescript-next",
12-
"dbaeumer.vscode-eslint",
13-
"esbenp.prettier-vscode",
14-
"dozerg.tsimportsorter",
15-
"svelte.svelte-vscode",
16-
"bradlc.vscode-tailwindcss",
17-
"vunguyentuan.vscode-postcss",
18-
"vunguyentuan.vscode-css-variables",
19-
"EthanSK.restore-terminals",
20-
"antfu.iconify",
21-
"heybourn.headwind",
22-
"bierner.github-markdown-preview"
23-
]
24-
}
25-
}
26-
}
2+
"name": "Svelte-Static",
3+
"dockerComposeFile": "./docker-compose.yml",
4+
"service": "svelte-static",
5+
"remoteUser": "developer",
6+
"workspaceFolder": "/svelte-static",
7+
"postCreateCommand": ".devcontainer/post-create.sh",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"ms-vscode.vscode-typescript-next",
12+
"dbaeumer.vscode-eslint",
13+
"esbenp.prettier-vscode",
14+
"dozerg.tsimportsorter",
15+
"svelte.svelte-vscode",
16+
"bradlc.vscode-tailwindcss",
17+
"vunguyentuan.vscode-postcss",
18+
"vunguyentuan.vscode-css-variables",
19+
"EthanSK.restore-terminals",
20+
"antfu.iconify",
21+
"heybourn.headwind",
22+
"bierner.github-markdown-preview"
23+
]
24+
}
25+
}
26+
}

.prettierrc

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"useTabs": true,
3-
"singleQuote": true,
4-
"trailingComma": "none",
5-
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7-
"overrides": [
8-
{
9-
"files": "*.svelte",
10-
"options": {
11-
"parser": "svelte"
12-
}
13-
}
14-
]
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
1515
}

.vscode/settings.json

+54-58
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,55 @@
11
{
2-
"[typescript]": {
3-
"editor.defaultFormatter": "esbenp.prettier-vscode"
4-
},
5-
"[javascript]": {
6-
"editor.defaultFormatter": "esbenp.prettier-vscode"
7-
},
8-
"[svelte]": {
9-
"editor.defaultFormatter": "svelte.svelte-vscode"
10-
},
11-
"editor.codeActionsOnSave": {
12-
"source.fixAll": "explicit",
13-
"source.unusedImports": "explicit",
14-
"source.organizeImports": "explicit"
15-
},
16-
"files.associations": {
17-
"*.css": "tailwindcss"
18-
},
19-
"restoreTerminals.terminals": [
20-
{
21-
"splitTerminals": [
22-
{
23-
"name": "mock api",
24-
"commands": [
25-
"echo 'Pretending you have a local server running...'",
26-
"echo 'You can delete this in your .vscode/settings.json.'",
27-
"npx local-cors-proxy --proxyUrl https://dummyjson.com --port 3000"
28-
]
29-
},
30-
]
31-
},
32-
{
33-
"splitTerminals": [
34-
{
35-
"name": "dev",
36-
"commands": [
37-
"npm install && npm run test:unit -- --run && npm run dev -- --host"
38-
]
39-
},
40-
{
41-
"name": "preview",
42-
"commands": [
43-
"npm install && npm run test:e2e && npm run preview -- --host"
44-
]
45-
},
46-
]
47-
},
48-
{
49-
"splitTerminals": [
50-
{
51-
"name": "bash",
52-
"commands": []
53-
},
54-
]
55-
}
56-
],
57-
// Fix the double formatter issue that leaves invalid code for imports.
58-
"typescript.format.enable": false
59-
}
2+
"[typescript]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
},
5+
"[javascript]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[svelte]": {
9+
"editor.defaultFormatter": "svelte.svelte-vscode"
10+
},
11+
"editor.codeActionsOnSave": {
12+
"source.fixAll": "explicit",
13+
"source.unusedImports": "explicit",
14+
"source.organizeImports": "explicit"
15+
},
16+
"files.associations": {
17+
"*.css": "tailwindcss"
18+
},
19+
"restoreTerminals.terminals": [
20+
{
21+
"splitTerminals": [
22+
{
23+
"name": "mock api",
24+
"commands": [
25+
"echo 'Pretending you have a local server running...'",
26+
"echo 'You can delete this in your .vscode/settings.json.'",
27+
"npx local-cors-proxy --proxyUrl https://dummyjson.com --port 3000"
28+
]
29+
}
30+
]
31+
},
32+
{
33+
"splitTerminals": [
34+
{
35+
"name": "dev",
36+
"commands": ["npm install && npm run test:unit -- --run && npm run dev -- --host"]
37+
},
38+
{
39+
"name": "preview",
40+
"commands": ["npm install && npm run test:e2e && npm run preview -- --host"]
41+
}
42+
]
43+
},
44+
{
45+
"splitTerminals": [
46+
{
47+
"name": "bash",
48+
"commands": []
49+
}
50+
]
51+
}
52+
],
53+
// Fix the double formatter issue that leaves invalid code for imports.
54+
"typescript.format.enable": false
55+
}

e2e/demo.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, test } from '@playwright/test';
22

33
test('home page has expected h1', async ({ page }) => {
4-
await page.goto('/');
5-
await expect(page.locator('h1')).toBeVisible();
4+
await page.goto('/');
5+
await expect(page.locator('h1')).toBeVisible();
66
});

eslint.config.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ import globals from 'globals';
55
import ts from 'typescript-eslint';
66

77
export default ts.config(
8-
js.configs.recommended,
9-
...ts.configs.recommended,
10-
...svelte.configs['flat/recommended'],
11-
prettier,
12-
...svelte.configs['flat/prettier'],
13-
{
14-
languageOptions: {
15-
globals: {
16-
...globals.browser,
17-
...globals.node
18-
}
19-
}
20-
},
21-
{
22-
files: ['**/*.svelte'],
8+
js.configs.recommended,
9+
...ts.configs.recommended,
10+
...svelte.configs['flat/recommended'],
11+
prettier,
12+
...svelte.configs['flat/prettier'],
13+
{
14+
languageOptions: {
15+
globals: {
16+
...globals.browser,
17+
...globals.node
18+
}
19+
}
20+
},
21+
{
22+
files: ['**/*.svelte'],
2323

24-
languageOptions: {
25-
parserOptions: {
26-
parser: ts.parser
27-
}
28-
}
29-
},
30-
{
31-
ignores: ['build/', '.svelte-kit/', 'dist/']
32-
}
24+
languageOptions: {
25+
parserOptions: {
26+
parser: ts.parser
27+
}
28+
}
29+
},
30+
{
31+
ignores: ['build/', '.svelte-kit/', 'dist/']
32+
}
3333
);

package.json

+50-50
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
{
2-
"name": "svelte-static",
3-
"version": "0.0.1",
4-
"type": "module",
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-
"format": "prettier --write .",
12-
"lint": "prettier --check . && eslint .",
13-
"obfuscate": "javascript-obfuscator ./build --output ./build",
14-
"test:unit": "vitest",
15-
"test": "npm run test:unit -- --run && npm run test:e2e",
16-
"test:e2e": "playwright test"
17-
},
18-
"devDependencies": {
19-
"@iconify/json": "^2.2.273",
20-
"@playwright/test": "^1.45.3",
21-
"@sveltejs/adapter-static": "^3.0.6",
22-
"@sveltejs/kit": "^2.0.0",
23-
"@sveltejs/vite-plugin-svelte": "^4.0.0",
24-
"@types/eslint": "^9.6.0",
25-
"autoprefixer": "^10.4.20",
26-
"eslint": "^9.7.0",
27-
"eslint-config-prettier": "^9.1.0",
28-
"eslint-plugin-svelte": "^2.36.0",
29-
"globals": "^15.0.0",
30-
"javascript-obfuscator": "^4.1.1",
31-
"luxon": "^3.5.0",
32-
"postcss": "^8.4.49",
33-
"postcss-import": "^16.1.0",
34-
"prettier": "^3.3.2",
35-
"prettier-plugin-svelte": "^3.2.6",
36-
"prettier-plugin-tailwindcss": "^0.6.5",
37-
"svelte": "^5.0.0",
38-
"svelte-check": "^4.0.0",
39-
"tailwindcss": "^3.4.9",
40-
"typescript": "^5.0.0",
41-
"typescript-eslint": "^8.0.0",
42-
"unplugin-icons": "^0.20.1",
43-
"vite": "^5.0.3",
44-
"vitest": "^2.0.4"
45-
},
46-
"dependencies": {
47-
"@tailwindcss/aspect-ratio": "^0.4.2",
48-
"@tailwindcss/container-queries": "^0.1.1",
49-
"@tailwindcss/forms": "^0.5.9",
50-
"@tailwindcss/typography": "^0.5.15"
51-
}
2+
"name": "svelte-static",
3+
"version": "0.0.1",
4+
"type": "module",
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+
"format": "prettier --write .",
12+
"lint": "prettier --check . && eslint .",
13+
"obfuscate": "javascript-obfuscator ./build --output ./build",
14+
"test:unit": "vitest",
15+
"test": "npm run test:unit -- --run && npm run test:e2e",
16+
"test:e2e": "playwright test"
17+
},
18+
"devDependencies": {
19+
"@iconify/json": "^2.2.273",
20+
"@playwright/test": "^1.45.3",
21+
"@sveltejs/adapter-static": "^3.0.6",
22+
"@sveltejs/kit": "^2.0.0",
23+
"@sveltejs/vite-plugin-svelte": "^4.0.0",
24+
"@types/eslint": "^9.6.0",
25+
"autoprefixer": "^10.4.20",
26+
"eslint": "^9.7.0",
27+
"eslint-config-prettier": "^9.1.0",
28+
"eslint-plugin-svelte": "^2.36.0",
29+
"globals": "^15.0.0",
30+
"javascript-obfuscator": "^4.1.1",
31+
"luxon": "^3.5.0",
32+
"postcss": "^8.4.49",
33+
"postcss-import": "^16.1.0",
34+
"prettier": "^3.3.2",
35+
"prettier-plugin-svelte": "^3.2.6",
36+
"prettier-plugin-tailwindcss": "^0.6.5",
37+
"svelte": "^5.0.0",
38+
"svelte-check": "^4.0.0",
39+
"tailwindcss": "^3.4.9",
40+
"typescript": "^5.0.0",
41+
"typescript-eslint": "^8.0.0",
42+
"unplugin-icons": "^0.20.1",
43+
"vite": "^5.0.3",
44+
"vitest": "^2.0.4"
45+
},
46+
"dependencies": {
47+
"@tailwindcss/aspect-ratio": "^0.4.2",
48+
"@tailwindcss/container-queries": "^0.1.1",
49+
"@tailwindcss/forms": "^0.5.9",
50+
"@tailwindcss/typography": "^0.5.15"
51+
}
5252
}

playwright.config.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { defineConfig } from '@playwright/test';
22

33
export default defineConfig({
4-
webServer: {
5-
command: 'npm run build && npm run obfuscate && npm run preview',
6-
port: 4173,
7-
reuseExistingServer: true
8-
},
4+
webServer: {
5+
command: 'npm run build && npm run obfuscate && npm run preview',
6+
port: 4173,
7+
reuseExistingServer: true
8+
},
99

10-
testDir: 'e2e'
10+
testDir: 'e2e'
1111
});

postcss.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
2-
plugins: {
3-
'postcss-import': {},
4-
tailwindcss: {},
5-
autoprefixer: {}
6-
}
2+
plugins: {
3+
'postcss-import': {},
4+
tailwindcss: {},
5+
autoprefixer: {}
6+
}
77
};

0 commit comments

Comments
 (0)