Skip to content

Commit

Permalink
set tabs=false in .prettierrc. npm run format
Browse files Browse the repository at this point in the history
  • Loading branch information
jifalops committed Nov 19, 2024
1 parent de5e120 commit 9fb0ca4
Show file tree
Hide file tree
Showing 29 changed files with 444 additions and 448 deletions.
50 changes: 25 additions & 25 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "Svelte-Static",
"dockerComposeFile": "./docker-compose.yml",
"service": "svelte-static",
"remoteUser": "developer",
"workspaceFolder": "/svelte-static",
"postCreateCommand": ".devcontainer/post-create.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-typescript-next",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"dozerg.tsimportsorter",
"svelte.svelte-vscode",
"bradlc.vscode-tailwindcss",
"vunguyentuan.vscode-postcss",
"vunguyentuan.vscode-css-variables",
"EthanSK.restore-terminals",
"antfu.iconify",
"heybourn.headwind",
"bierner.github-markdown-preview"
]
}
}
}
"name": "Svelte-Static",
"dockerComposeFile": "./docker-compose.yml",
"service": "svelte-static",
"remoteUser": "developer",
"workspaceFolder": "/svelte-static",
"postCreateCommand": ".devcontainer/post-create.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-typescript-next",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"dozerg.tsimportsorter",
"svelte.svelte-vscode",
"bradlc.vscode-tailwindcss",
"vunguyentuan.vscode-postcss",
"vunguyentuan.vscode-css-variables",
"EthanSK.restore-terminals",
"antfu.iconify",
"heybourn.headwind",
"bierner.github-markdown-preview"
]
}
}
}
26 changes: 13 additions & 13 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
"useTabs": false,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
112 changes: 54 additions & 58 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,55 @@
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.unusedImports": "explicit",
"source.organizeImports": "explicit"
},
"files.associations": {
"*.css": "tailwindcss"
},
"restoreTerminals.terminals": [
{
"splitTerminals": [
{
"name": "mock api",
"commands": [
"echo 'Pretending you have a local server running...'",
"echo 'You can delete this in your .vscode/settings.json.'",
"npx local-cors-proxy --proxyUrl https://dummyjson.com --port 3000"
]
},
]
},
{
"splitTerminals": [
{
"name": "dev",
"commands": [
"npm install && npm run test:unit -- --run && npm run dev -- --host"
]
},
{
"name": "preview",
"commands": [
"npm install && npm run test:e2e && npm run preview -- --host"
]
},
]
},
{
"splitTerminals": [
{
"name": "bash",
"commands": []
},
]
}
],
// Fix the double formatter issue that leaves invalid code for imports.
"typescript.format.enable": false
}
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.unusedImports": "explicit",
"source.organizeImports": "explicit"
},
"files.associations": {
"*.css": "tailwindcss"
},
"restoreTerminals.terminals": [
{
"splitTerminals": [
{
"name": "mock api",
"commands": [
"echo 'Pretending you have a local server running...'",
"echo 'You can delete this in your .vscode/settings.json.'",
"npx local-cors-proxy --proxyUrl https://dummyjson.com --port 3000"
]
}
]
},
{
"splitTerminals": [
{
"name": "dev",
"commands": ["npm install && npm run test:unit -- --run && npm run dev -- --host"]
},
{
"name": "preview",
"commands": ["npm install && npm run test:e2e && npm run preview -- --host"]
}
]
},
{
"splitTerminals": [
{
"name": "bash",
"commands": []
}
]
}
],
// Fix the double formatter issue that leaves invalid code for imports.
"typescript.format.enable": false
}
4 changes: 2 additions & 2 deletions e2e/demo.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';

test('home page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.locator('h1')).toBeVisible();
await page.goto('/');
await expect(page.locator('h1')).toBeVisible();
});
48 changes: 24 additions & 24 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ import globals from 'globals';
import ts from 'typescript-eslint';

export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],

languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
);
100 changes: 50 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
{
"name": "svelte-static",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"obfuscate": "javascript-obfuscator ./build --output ./build",
"test:unit": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:e2e": "playwright test"
},
"devDependencies": {
"@iconify/json": "^2.2.273",
"@playwright/test": "^1.45.3",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@types/eslint": "^9.6.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"javascript-obfuscator": "^4.1.1",
"luxon": "^3.5.0",
"postcss": "^8.4.49",
"postcss-import": "^16.1.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"unplugin-icons": "^0.20.1",
"vite": "^5.0.3",
"vitest": "^2.0.4"
},
"dependencies": {
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15"
}
"name": "svelte-static",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"obfuscate": "javascript-obfuscator ./build --output ./build",
"test:unit": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:e2e": "playwright test"
},
"devDependencies": {
"@iconify/json": "^2.2.273",
"@playwright/test": "^1.45.3",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@types/eslint": "^9.6.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"javascript-obfuscator": "^4.1.1",
"luxon": "^3.5.0",
"postcss": "^8.4.49",
"postcss-import": "^16.1.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"unplugin-icons": "^0.20.1",
"vite": "^5.0.3",
"vitest": "^2.0.4"
},
"dependencies": {
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15"
}
}
12 changes: 6 additions & 6 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineConfig } from '@playwright/test';

export default defineConfig({
webServer: {
command: 'npm run build && npm run obfuscate && npm run preview',
port: 4173,
reuseExistingServer: true
},
webServer: {
command: 'npm run build && npm run obfuscate && npm run preview',
port: 4173,
reuseExistingServer: true
},

testDir: 'e2e'
testDir: 'e2e'
});
10 changes: 5 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
plugins: {
'postcss-import': {},
tailwindcss: {},
autoprefixer: {}
}
plugins: {
'postcss-import': {},
tailwindcss: {},
autoprefixer: {}
}
};
Loading

0 comments on commit 9fb0ca4

Please sign in to comment.