Skip to content

Commit

Permalink
exclude create-svelte/template files from prettier, so that we can em…
Browse files Browse the repository at this point in the history
…it correctly formatted templates
  • Loading branch information
Rich Harris committed May 16, 2023
1 parent 14f524c commit aa188d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
11 changes: 8 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
"printWidth": 100,
"overrides": [
{
"files": ["*.svelte"],
"files": [
"*.svelte"
],
"options": {
"bracketSameLine": false
}
},
{
"files": ["packages/*/README.md"],
"files": [
"packages/*/README.md"
],
"options": {
"useTabs": false,
"tabWidth": 2
Expand All @@ -22,6 +26,7 @@
"**/CHANGELOG.md",
"**/.svelte-kit/**",
"documentation/**/*.md",
"packages/create-svelte/templates/**",
"packages/package/test/fixtures/**/expected/**/*",
"packages/package/test/watch/expected/**/*",
"packages/package/test/watch/package/**/*",
Expand All @@ -33,4 +38,4 @@
}
}
]
}
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@
*/
function update(event: MouseEvent) {
const guess = data.guesses[i];
const key = /** @type {HTMLButtonElement} */ (event.target as HTMLButtonElement).getAttribute(
'data-key'
);
const key = /** @type {HTMLButtonElement} */ (event.target as HTMLButtonElement).getAttribute('data-key');
if (key === 'backspace') {
data.guesses[i] = guess.slice(0, -1);
Expand Down
3 changes: 1 addition & 2 deletions packages/create-svelte/test/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ for (const template of templates) {

// run provided scripts that are non-blocking. All of them should exit with 0
// package script requires lib dir
// TODO: lint should run before format
const scripts_to_test = ['format', 'lint', 'check', 'build', 'package'].filter(
const scripts_to_test = ['lint', 'format', 'check', 'build', 'package'].filter(
(s) => s in pkg.scripts
);

Expand Down

0 comments on commit aa188d4

Please sign in to comment.