Skip to content

Commit 9534d17

Browse files
authored
chore: add prettier and format files (#11)
* chore: add `prettier` * chore: format files * chore: preserve previous format for defineConfig
1 parent b8b04d5 commit 9534d17

File tree

37 files changed

+114
-99
lines changed

37 files changed

+114
-99
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"postbuild": "cp _headers ./dist/",
1111
"dev": "astro dev",
1212
"preview": "astro preview",
13-
"start": "astro dev"
13+
"start": "astro dev",
14+
"format": "prettier src --write"
1415
},
1516
"dependencies": {
1617
"@tutorialkit/components-react": "^0.0.1",
@@ -30,10 +31,14 @@
3031
"@unocss/transformer-directives": "^0.59.4",
3132
"astro": "^4.8.6",
3233
"fast-glob": "^3.3.2",
34+
"prettier": "^3.3.3",
3335
"prettier-plugin-astro": "^0.13.0",
3436
"typescript": "^5.4.5",
3537
"unocss": "^0.59.4",
3638
"vite": "^5.2.0",
3739
"yaml": "^2.4.5"
40+
},
41+
"prettier": {
42+
"trailingComma": "none"
3843
}
3944
}

pnpm-lock.yaml

Lines changed: 14 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/content/config.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import { chapterSchema, lessonSchema, partSchema, tutorialSchema } from '@tutorialkit/types';
2-
import { defineCollection } from 'astro:content';
1+
import {
2+
chapterSchema,
3+
lessonSchema,
4+
partSchema,
5+
tutorialSchema
6+
} from "@tutorialkit/types";
7+
import { defineCollection } from "astro:content";
38

49
const tutorial = defineCollection({
5-
type: 'content',
6-
schema: tutorialSchema.or(partSchema).or(chapterSchema).or(lessonSchema),
10+
type: "content",
11+
schema: tutorialSchema.or(partSchema).or(chapterSchema).or(lessonSchema)
712
});
813

914
export const collections = { tutorial };

src/content/tutorial/vite-plugin/env-plugin/env-variables-in-load-hook/_files/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
if (id === "\0virtual:tutorial-env") {
1414
return "export default 'This should work 🤔'";
1515
}
16-
},
17-
},
18-
],
16+
}
17+
}
18+
]
1919
});

src/content/tutorial/vite-plugin/env-plugin/env-variables-in-load-hook/_solution/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export default defineConfig({
1414
const envVars = getTutorialEnvVariables();
1515
return `export default ${JSON.stringify(envVars)}`;
1616
}
17-
},
18-
},
19-
],
17+
}
18+
}
19+
]
2020
});
2121

2222
function getTutorialEnvVariables() {

src/content/tutorial/vite-plugin/env-plugin/importing-virtual-module/_solution/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
if (id === "virtual:tutorial-env") {
99
return "export default 'This should work 🤔'";
1010
}
11-
},
12-
},
13-
],
11+
}
12+
}
13+
]
1414
});

src/content/tutorial/vite-plugin/env-plugin/importing-virtual-module/content.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Let's add a new plugin with the name `env-plugin`.
2525
export default defineConfig({
2626
plugins: [
2727
{
28-
name: "env-plugin",
29-
},
30-
],
28+
name: "env-plugin"
29+
}
30+
]
3131
});
3232
```
3333

src/content/tutorial/vite-plugin/env-plugin/resolve-id-of-virtual-module/_files/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
if (id === "virtual:tutorial-env") {
99
return "export default 'This should work 🤔'";
1010
}
11-
},
12-
},
13-
],
11+
}
12+
}
13+
]
1414
});

src/content/tutorial/vite-plugin/env-plugin/resolve-id-of-virtual-module/_solution/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
if (id === "\0virtual:tutorial-env") {
1414
return "export default 'This should work 🤔'";
1515
}
16-
},
17-
},
18-
],
16+
}
17+
}
18+
]
1919
});

src/content/tutorial/vite-plugin/env-plugin/summarize-env-plugin/_files/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export default defineConfig({
1414
const envVars = getTutorialEnvVariables();
1515
return `export default ${JSON.stringify(envVars)}`;
1616
}
17-
},
18-
},
19-
],
17+
}
18+
}
19+
]
2020
});
2121

2222
function getTutorialEnvVariables() {

0 commit comments

Comments
 (0)