Skip to content

Commit

Permalink
chore: Enable tailwind prettier plugin (#34)
Browse files Browse the repository at this point in the history
* chore: enable tailwind prettier plugin

* chore: format

* fix(prettier): enable prettier for yaml except pnpm lock
  • Loading branch information
jsun969 authored Jan 20, 2024
1 parent 43aeae1 commit 7f2b0e2
Show file tree
Hide file tree
Showing 30 changed files with 1,212 additions and 3,140 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/coverage
/build
node_modules
pnpm-lock.yaml
37 changes: 0 additions & 37 deletions .prettierrc

This file was deleted.

47 changes: 47 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @type {import('prettier').Config &
* import('prettier-plugin-tailwindcss').PluginOptions &
* import('@trivago/prettier-plugin-sort-imports').PluginConfig &
* import('prettier-plugin-jsdoc').Options}
*/
module.exports = {
plugins: [
'prettier-plugin-jsdoc',
'@trivago/prettier-plugin-sort-imports',
'prettier-plugin-tailwindcss',
],
trailingComma: 'es5',
bracketSpacing: true,
bracketSameLine: false,
singleQuote: true,
quoteProps: 'as-needed',
arrowParens: 'always',
useTabs: false,
tabWidth: 4,
printWidth: 100,
semi: true,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
endOfLine: 'lf',
jsxSingleQuote: false,
singleAttributePerLine: false,
htmlWhitespaceSensitivity: 'css',
embeddedLanguageFormatting: 'auto',
importOrderSeparation: false,
importOrder: ['<THIRD_PARTY_MODULES>', '^[./]', '<THIRD_PARTY_TYPES>', '<TYPE>^[./]'],
overrides: [
{
files: ['*.yaml', '*.yml', '*.json', '*.config.{js,ts}', '*rc', '*rc.{js,ts}'],
options: {
tabWidth: 2,
},
},
{
files: '*.html',
options: {
singleQuote: false,
},
},
],
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"analyse": "cross-env ANALYSE=true next build",
"start": "next start",
"lint": "cross-env SKIP_ENV_VALIDATION=true next lint",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,css,json,yaml,yml,mjs}\"",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,css,json,yaml,yml,mjs}\""
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,css,json,mjs,cjs,yml,yaml}\"",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,css,json,mjs,cjs,yml,yaml}\""
},
"dependencies": {
"@clerk/clerk-react": "^4.30.3",
Expand Down Expand Up @@ -48,7 +48,7 @@
"typescript": "^5.3.3"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,css,json,yaml,yml}": [
"*.{js,jsx,ts,tsx,css,json,mjs,cjs,yml,yaml}": [
"prettier --write"
]
},
Expand Down
Loading

0 comments on commit 7f2b0e2

Please sign in to comment.