Skip to content

Commit d081ecf

Browse files
authored
tooling: prettier for astro and tailwind (kamranahmedse#3732)
* tooling: prettier for astro and tailwind Prettier configuration for Astro component's formatting and Tailwind CSS class sorting. * fix: single quote for props
1 parent d8a0396 commit d081ecf

File tree

5 files changed

+93
-8
lines changed

5 files changed

+93
-8
lines changed

.prettierrc.cjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
semi: true,
3+
singleQuote: true,
4+
overrides: [
5+
{
6+
files: '*.astro',
7+
options: {
8+
parser: 'astro',
9+
singleQuote: true,
10+
jsxSingleQuote: true,
11+
},
12+
},
13+
],
14+
plugins: [
15+
require.resolve('prettier-plugin-astro'),
16+
require('prettier-plugin-tailwindcss'),
17+
],
18+
};

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"prettier.documentSelectors": ["**/*.astro"],
3+
"[astro]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
}
6+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"markdown-it": "^13.0.1",
3838
"openai": "^3.2.1",
3939
"prettier": "^2.8.7",
40-
"prettier-plugin-astro": "^0.8.0"
40+
"prettier-plugin-astro": "^0.8.0",
41+
"prettier-plugin-tailwindcss": "^0.2.6"
4142
}
4243
}

pnpm-lock.yaml

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

src/pages/roadmaps.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const skillRoadmaps = await getRoadmapsByTag('skill-roadmap');
1919
showYouTubeAlert={true}
2020
/>
2121

22-
<div class='bg-gray-100 pt-4 pb-14 sm:pt-8 sm:pb-16'>
22+
<div class='flex bg-gray-100 pt-4 pb-14 sm:pt-8 sm:pb-16'>
2323
<div class='container'>
24-
<div class='grid grid-cols-1 sm:grid-cols-2 gap-0.5 sm:gap-3'>
24+
<div class='grid grid-cols-1 gap-0.5 sm:grid-cols-2 sm:gap-3'>
2525
{
2626
roleRoadmaps.map((roleRoadmap) => (
2727
<GridItem
@@ -46,4 +46,4 @@ const skillRoadmaps = await getRoadmapsByTag('skill-roadmap');
4646
</div>
4747
</div>
4848
</div>
49-
</BaseLayout>
49+
</BaseLayout>

0 commit comments

Comments
 (0)