Skip to content

Commit

Permalink
feat: Add Prettier plugin for TailwindCSS
Browse files Browse the repository at this point in the history
The plugin auto-sorts the used classes.
  • Loading branch information
MoritzWeber0 committed Oct 10, 2023
1 parent 95caafb commit b375b51
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ repos:
hooks:
- id: prettier
types_or: [ts, css, html, markdown]
files: "^frontend"
additional_dependencies:
- "prettier@^3.0.3"
- "prettier-plugin-tailwindcss@^0.5.5"
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
hooks:
Expand Down
8 changes: 8 additions & 0 deletions frontend/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors
* SPDX-License-Identifier: CC0-1.0
*/

module.exports = {
plugins: [require.resolve("prettier-plugin-tailwindcss")],
};
89 changes: 89 additions & 0 deletions frontend/package-lock.json

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

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.5",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"webpack": "^5.88.2"
Expand Down

0 comments on commit b375b51

Please sign in to comment.