Skip to content

Commit c33cd6e

Browse files
authored
chore: enable prettier for json and reformat (#663)
* chore: enable prettier for json and reformat * fix(prettier): leave renovate config alone and format all files in precommit
1 parent d7fd5a9 commit c33cd6e

File tree

24 files changed

+280
-277
lines changed

24 files changed

+280
-277
lines changed

.changeset/config.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3-
"changelog": ["@svitejs/changesets-changelog-github-compact", { "repo": "sveltejs/vite-plugin-svelte" }],
4-
"commit": false,
5-
"linked": [],
6-
"access": "public",
7-
"baseBranch": "main",
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{ "repo": "sveltejs/vite-plugin-svelte" }
6+
],
7+
"commit": false,
8+
"linked": [],
9+
"access": "public",
10+
"baseBranch": "main",
811
"bumpVersionsWithWorkspaceProtocolOnly": true,
9-
"ignore": ["!(@sveltejs/*)"]
12+
"ignore": ["!(@sveltejs/*)"]
1013
}
11-

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "\U0001F41E Bug report"
22
description: for reproducible bugs in vite-plugin-svelte only.
3-
labels: ["bug", "triage"]
3+
labels: ['bug', 'triage']
44
body:
55
- type: markdown
66
attributes:
@@ -43,4 +43,3 @@ body:
4343
placeholder: System, Binaries, Browsers
4444
validations:
4545
required: true
46-

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
options: { parser: 'typescript' }
1515
},
1616
{
17-
files: '**/CHANGELOG.md',
17+
files: ['**/CHANGELOG.md', '.github/renovate.json5'],
1818
options: {
1919
requirePragma: true
2020
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"check:publint": "pnpm --filter \"./packages/*\" --parallel check:publint",
1212
"check:types": "pnpm --filter \"./packages/*\" --parallel check:types",
1313
"check:lint": "eslint --cache --ignore-path .gitignore '**/*.{js,ts,svelte,html,svx,md}'",
14-
"check:format": "prettier --cache --ignore-path .gitignore '**/*.{css,scss,svelte,html,js,ts,svx,md}' --check",
14+
"check:format": "prettier --cache --ignore-path .gitignore . --ignore-unknown --check",
1515
"lint": "pnpm check:lint --fix",
1616
"format": "pnpm check:format --write",
1717
"fixup": "run-s lint format",
@@ -53,8 +53,8 @@
5353
},
5454
"lint-staged": {
5555
"*.{js,ts,svelte,html,md,svx}": "eslint --cache --fix",
56-
"*.{css,scss,svelte,html,js,ts,svx,md}": [
57-
"prettier --cache --write"
56+
"*": [
57+
"prettier --cache --ignore-unknown --write"
5858
]
5959
},
6060
"packageManager": "[email protected]",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
cjs_and_esm: () => 'cjs'
3-
}
3+
};
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export function cjs_and_esm() { return 'esm' };
1+
export function cjs_and_esm() {
2+
return 'esm';
3+
}

packages/e2e-tests/_test_dependencies/cjs-and-esm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"index.mjs",
99
"index.cjs"
1010
],
11-
"exports":{
11+
"exports": {
1212
".": {
1313
"import": "./index.mjs",
1414
"require": "./index.cjs"

packages/e2e-tests/_test_dependencies/esm-only/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"files": [
77
"esm.js"
88
],
9-
"exports":{
9+
"exports": {
1010
".": {
1111
"import": "./esm.js"
1212
},

packages/e2e-tests/_test_dependencies/svelte-exports-simple/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"files": [
1010
"src",
1111
"index.js",
12-
"index.svelte.js"
12+
"index.svelte.js"
1313
],
14-
"svelte": "./index.svelte.js",
15-
"exports": {
16-
"./*": {
17-
"svelte": "./src/components/*"
18-
},
19-
".": {
20-
"svelte": "./index.js"
21-
}
22-
}
14+
"svelte": "./index.svelte.js",
15+
"exports": {
16+
"./*": {
17+
"svelte": "./src/components/*"
18+
},
19+
".": {
20+
"svelte": "./index.js"
21+
}
22+
}
2323
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
console.log('default svelte config loaded')
1+
console.log('default svelte config loaded');
22
module.exports = {};

packages/e2e-tests/configfile-custom/svelte.config.custom.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
console.log('custom svelte config loaded cjs')
1+
console.log('custom svelte config loaded cjs');
22
module.exports = {
33
vitePlugin: {
44
emitCss: false
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
console.log('custom svelte config loaded mjs')
1+
console.log('custom svelte config loaded mjs');
22
export default {
33
vitePlugin: {
44
emitCss: false
55
}
6-
}
6+
};
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
2-
"compilerOptions": {
3-
"moduleResolution": "node",
4-
"target": "esnext",
5-
"module": "esnext",
6-
/**
7-
* svelte-preprocess cannot figure out whether you have
8-
* a value or a type, so tell TypeScript to enforce using
9-
* `import type` instead of `import` for Types.
10-
*/
11-
"importsNotUsedAsValues": "error",
12-
"isolatedModules": true,
13-
"resolveJsonModule": true,
14-
/**
15-
* To have warnings / errors of the Svelte compiler at the
16-
* correct position, enable source maps by default.
17-
*/
18-
"sourceMap": true,
19-
"esModuleInterop": true,
20-
"skipLibCheck": true,
21-
"forceConsistentCasingInFileNames": true,
22-
"baseUrl": ".",
23-
/**
24-
* Typecheck JS in `.svelte` and `.js` files by default.
25-
* Disable this if you'd like to use dynamic types.
26-
*/
27-
"checkJs": true
28-
},
29-
/**
30-
* Use global.d.ts instead of compilerOptions.types
31-
* to avoid limiting type declarations.
32-
*/
33-
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
2+
"compilerOptions": {
3+
"moduleResolution": "node",
4+
"target": "esnext",
5+
"module": "esnext",
6+
/**
7+
* svelte-preprocess cannot figure out whether you have
8+
* a value or a type, so tell TypeScript to enforce using
9+
* `import type` instead of `import` for Types.
10+
*/
11+
"importsNotUsedAsValues": "error",
12+
"isolatedModules": true,
13+
"resolveJsonModule": true,
14+
/**
15+
* To have warnings / errors of the Svelte compiler at the
16+
* correct position, enable source maps by default.
17+
*/
18+
"sourceMap": true,
19+
"esModuleInterop": true,
20+
"skipLibCheck": true,
21+
"forceConsistentCasingInFileNames": true,
22+
"baseUrl": ".",
23+
/**
24+
* Typecheck JS in `.svelte` and `.js` files by default.
25+
* Disable this if you'd like to use dynamic types.
26+
*/
27+
"checkJs": true
28+
},
29+
/**
30+
* Use global.d.ts instead of compilerOptions.types
31+
* to avoid limiting type declarations.
32+
*/
33+
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
3434
}
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
2-
"compilerOptions": {
3-
"moduleResolution": "node",
4-
"target": "esnext",
5-
"module": "esnext",
6-
/**
7-
* svelte-preprocess cannot figure out whether you have
8-
* a value or a type, so tell TypeScript to enforce using
9-
* `import type` instead of `import` for Types.
10-
*/
11-
"importsNotUsedAsValues": "error",
12-
"isolatedModules": true,
13-
/**
14-
* To have warnings / errors of the Svelte compiler at the
15-
* correct position, enable source maps by default.
16-
*/
17-
"sourceMap": true,
18-
"esModuleInterop": true,
19-
"skipLibCheck": true,
20-
"forceConsistentCasingInFileNames": true,
21-
"baseUrl": ".",
22-
/**
23-
* Typecheck JS in `.svelte` and `.js` files by default.
24-
* Disable checkJs if you'd like to use dynamic types in JS.
25-
* Note that setting allowJs false does not prevent the use
26-
* of JS in `.svelte` files.
27-
*/
28-
"allowJs": true,
29-
"checkJs": true
30-
},
31-
/**
32-
* Use global.d.ts instead of compilerOptions.types
33-
* to avoid limiting type declarations.
34-
*/
35-
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"]
2+
"compilerOptions": {
3+
"moduleResolution": "node",
4+
"target": "esnext",
5+
"module": "esnext",
6+
/**
7+
* svelte-preprocess cannot figure out whether you have
8+
* a value or a type, so tell TypeScript to enforce using
9+
* `import type` instead of `import` for Types.
10+
*/
11+
"importsNotUsedAsValues": "error",
12+
"isolatedModules": true,
13+
/**
14+
* To have warnings / errors of the Svelte compiler at the
15+
* correct position, enable source maps by default.
16+
*/
17+
"sourceMap": true,
18+
"esModuleInterop": true,
19+
"skipLibCheck": true,
20+
"forceConsistentCasingInFileNames": true,
21+
"baseUrl": ".",
22+
/**
23+
* Typecheck JS in `.svelte` and `.js` files by default.
24+
* Disable checkJs if you'd like to use dynamic types in JS.
25+
* Note that setting allowJs false does not prevent the use
26+
* of JS in `.svelte` files.
27+
*/
28+
"allowJs": true,
29+
"checkJs": true
30+
},
31+
/**
32+
* Use global.d.ts instead of compilerOptions.types
33+
* to avoid limiting type declarations.
34+
*/
35+
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"]
3636
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@tsconfig/svelte/tsconfig.json",
3-
"include": ["src/**/*"],
4-
"exclude": ["node_modules"]
2+
"extends": "@tsconfig/svelte/tsconfig.json",
3+
"include": ["src/**/*"],
4+
"exclude": ["node_modules"]
55
}

packages/e2e-tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"include": ["."],
3-
"exclude": ["**/dist/**","**/build/**","**/node_modules/**"],
3+
"exclude": ["**/dist/**", "**/build/**", "**/node_modules/**"],
44
"compilerOptions": {
55
"target": "esnext",
66
"module": "esnext",
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"name": "playground-big-component-library-kit",
3-
"version": "0.0.0",
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 ./jsconfig.json",
10-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
11-
},
12-
"devDependencies": {
13-
"@sveltejs/adapter-auto": "2.0.1",
14-
"@sveltejs/kit": "^1.16.3",
15-
"carbon-components-svelte": "^0.73.5",
16-
"carbon-icons-svelte": "^11.4.0",
17-
"carbon-preprocess-svelte": "^0.9.1",
18-
"lodash-es": "^4.17.21",
19-
"svelte": "^3.59.1",
20-
"svelte-check": "^3.3.2",
21-
"svelte-preprocess": "^5.0.3",
22-
"typescript": "^5.0.4",
23-
"vite": "^4.3.5"
24-
},
25-
"type": "module"
2+
"name": "playground-big-component-library-kit",
3+
"version": "0.0.0",
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 ./jsconfig.json",
10+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
11+
},
12+
"devDependencies": {
13+
"@sveltejs/adapter-auto": "2.0.1",
14+
"@sveltejs/kit": "^1.16.3",
15+
"carbon-components-svelte": "^0.73.5",
16+
"carbon-icons-svelte": "^11.4.0",
17+
"carbon-preprocess-svelte": "^0.9.1",
18+
"lodash-es": "^4.17.21",
19+
"svelte": "^3.59.1",
20+
"svelte-check": "^3.3.2",
21+
"svelte-preprocess": "^5.0.3",
22+
"typescript": "^5.0.4",
23+
"vite": "^4.3.5"
24+
},
25+
"type": "module"
2626
}

0 commit comments

Comments
 (0)