Skip to content

Commit

Permalink
tooling: prettier for astro and tailwind (kamranahmedse#3732)
Browse files Browse the repository at this point in the history
* tooling: prettier for astro and tailwind

Prettier configuration for Astro component's formatting and Tailwind CSS class sorting.

* fix: single quote for props
  • Loading branch information
arikchakma authored Mar 30, 2023
1 parent d8a0396 commit d081ecf
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 8 deletions.
18 changes: 18 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
semi: true,
singleQuote: true,
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
singleQuote: true,
jsxSingleQuote: true,
},
},
],
plugins: [
require.resolve('prettier-plugin-astro'),
require('prettier-plugin-tailwindcss'),
],
};
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"markdown-it": "^13.0.1",
"openai": "^3.2.1",
"prettier": "^2.8.7",
"prettier-plugin-astro": "^0.8.0"
"prettier-plugin-astro": "^0.8.0",
"prettier-plugin-tailwindcss": "^0.2.6"
}
}
68 changes: 64 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/pages/roadmaps.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const skillRoadmaps = await getRoadmapsByTag('skill-roadmap');
showYouTubeAlert={true}
/>

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

0 comments on commit d081ecf

Please sign in to comment.