Skip to content

Commit

Permalink
chore: enable prettier for json and reformat (#663)
Browse files Browse the repository at this point in the history
* chore: enable prettier for json and reformat

* fix(prettier): leave renovate config alone and format all files in precommit
  • Loading branch information
dominikg authored May 27, 2023
1 parent d7fd5a9 commit c33cd6e
Show file tree
Hide file tree
Showing 24 changed files with 280 additions and 277 deletions.
18 changes: 10 additions & 8 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@svitejs/changesets-changelog-github-compact", { "repo": "sveltejs/vite-plugin-svelte" }],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "sveltejs/vite-plugin-svelte" }
],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"bumpVersionsWithWorkspaceProtocolOnly": true,
"ignore": ["!(@sveltejs/*)"]
"ignore": ["!(@sveltejs/*)"]
}

3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "\U0001F41E Bug report"
description: for reproducible bugs in vite-plugin-svelte only.
labels: ["bug", "triage"]
labels: ['bug', 'triage']
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -43,4 +43,3 @@ body:
placeholder: System, Binaries, Browsers
validations:
required: true

2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
options: { parser: 'typescript' }
},
{
files: '**/CHANGELOG.md',
files: ['**/CHANGELOG.md', '.github/renovate.json5'],
options: {
requirePragma: true
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"check:publint": "pnpm --filter \"./packages/*\" --parallel check:publint",
"check:types": "pnpm --filter \"./packages/*\" --parallel check:types",
"check:lint": "eslint --cache --ignore-path .gitignore '**/*.{js,ts,svelte,html,svx,md}'",
"check:format": "prettier --cache --ignore-path .gitignore '**/*.{css,scss,svelte,html,js,ts,svx,md}' --check",
"check:format": "prettier --cache --ignore-path .gitignore . --ignore-unknown --check",
"lint": "pnpm check:lint --fix",
"format": "pnpm check:format --write",
"fixup": "run-s lint format",
Expand Down Expand Up @@ -53,8 +53,8 @@
},
"lint-staged": {
"*.{js,ts,svelte,html,md,svx}": "eslint --cache --fix",
"*.{css,scss,svelte,html,js,ts,svx,md}": [
"prettier --cache --write"
"*": [
"prettier --cache --ignore-unknown --write"
]
},
"packageManager": "[email protected]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
cjs_and_esm: () => 'cjs'
}
};
4 changes: 3 additions & 1 deletion packages/e2e-tests/_test_dependencies/cjs-and-esm/index.mjs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export function cjs_and_esm() { return 'esm' };
export function cjs_and_esm() {
return 'esm';
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"index.mjs",
"index.cjs"
],
"exports":{
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.cjs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"files": [
"esm.js"
],
"exports":{
"exports": {
".": {
"import": "./esm.js"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"files": [
"src",
"index.js",
"index.svelte.js"
"index.svelte.js"
],
"svelte": "./index.svelte.js",
"exports": {
"./*": {
"svelte": "./src/components/*"
},
".": {
"svelte": "./index.js"
}
}
"svelte": "./index.svelte.js",
"exports": {
"./*": {
"svelte": "./src/components/*"
},
".": {
"svelte": "./index.js"
}
}
}
2 changes: 1 addition & 1 deletion packages/e2e-tests/configfile-custom/svelte.config.cjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
console.log('default svelte config loaded')
console.log('default svelte config loaded');
module.exports = {};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
console.log('custom svelte config loaded cjs')
console.log('custom svelte config loaded cjs');
module.exports = {
vitePlugin: {
emitCss: false
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/configfile-custom/svelte.config.custom.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
console.log('custom svelte config loaded mjs')
console.log('custom svelte config loaded mjs');
export default {
vitePlugin: {
emitCss: false
}
}
};
64 changes: 32 additions & 32 deletions packages/e2e-tests/inspector-vite/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"compilerOptions": {
"moduleResolution": "node",
"target": "esnext",
"module": "esnext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
"compilerOptions": {
"moduleResolution": "node",
"target": "esnext",
"module": "esnext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
68 changes: 34 additions & 34 deletions packages/e2e-tests/svelte-preprocess/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"compilerOptions": {
"moduleResolution": "node",
"target": "esnext",
"module": "esnext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable checkJs if you'd like to use dynamic types in JS.
* Note that setting allowJs false does not prevent the use
* of JS in `.svelte` files.
*/
"allowJs": true,
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"]
"compilerOptions": {
"moduleResolution": "node",
"target": "esnext",
"module": "esnext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable checkJs if you'd like to use dynamic types in JS.
* Note that setting allowJs false does not prevent the use
* of JS in `.svelte` files.
*/
"allowJs": true,
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"]
}
6 changes: 3 additions & 3 deletions packages/e2e-tests/ts-type-import/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/svelte/tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"]
"extends": "@tsconfig/svelte/tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion packages/e2e-tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"include": ["."],
"exclude": ["**/dist/**","**/build/**","**/node_modules/**"],
"exclude": ["**/dist/**", "**/build/**", "**/node_modules/**"],
"compilerOptions": {
"target": "esnext",
"module": "esnext",
Expand Down
48 changes: 24 additions & 24 deletions packages/playground/big-component-library-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "playground-big-component-library-kit",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-auto": "2.0.1",
"@sveltejs/kit": "^1.16.3",
"carbon-components-svelte": "^0.73.5",
"carbon-icons-svelte": "^11.4.0",
"carbon-preprocess-svelte": "^0.9.1",
"lodash-es": "^4.17.21",
"svelte": "^3.59.1",
"svelte-check": "^3.3.2",
"svelte-preprocess": "^5.0.3",
"typescript": "^5.0.4",
"vite": "^4.3.5"
},
"type": "module"
"name": "playground-big-component-library-kit",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-auto": "2.0.1",
"@sveltejs/kit": "^1.16.3",
"carbon-components-svelte": "^0.73.5",
"carbon-icons-svelte": "^11.4.0",
"carbon-preprocess-svelte": "^0.9.1",
"lodash-es": "^4.17.21",
"svelte": "^3.59.1",
"svelte-check": "^3.3.2",
"svelte-preprocess": "^5.0.3",
"typescript": "^5.0.4",
"vite": "^4.3.5"
},
"type": "module"
}
Loading

0 comments on commit c33cd6e

Please sign in to comment.