Skip to content

Commit

Permalink
feat: 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Dec 16, 2022
1 parent c85856d commit ef1565c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notables change for @leomotors/config will be noted here

## [0.4.0] - 2022-12-16

- feat: add prettier-plugin-tailwindcss

## [0.3.0] - 2022-12-16

- experimental v3
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@leomotors/config",
"description": "My personal config for node projects, include ESLint Prettier and TSConfig",
"version": "0.3.0",
"version": "0.4.0",
"license": "MIT",
"author": {
"name": "Nutthapat Pongtanyavichai",
Expand Down Expand Up @@ -54,6 +54,7 @@
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
"prettier": "^2.8.1",
"prettier-plugin-tailwindcss": "^0.2.1",
"typescript": "^4.9.4"
},
"peerDependencies": {
Expand All @@ -70,6 +71,7 @@
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
"prettier": "^2.8.1",
"prettier-plugin-tailwindcss": "^0.2.1",
"typescript": "^4.9.4"
},
"peerDependenciesMeta": {
Expand All @@ -78,6 +80,9 @@
},
"eslint-plugin-react": {
"optional": true
},
"prettier-plugin-tailwindcss": {
"optional": true
}
}
}
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

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

21 changes: 21 additions & 0 deletions src/prettier/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,24 @@ export function withSortImports({ importOrder }: WithSortImportsOptions = {}) {
importOrderParserPlugins: ["typescript", "decorators-legacy", "jsx"],
} satisfies SortImportsConfig;
}

/**
* Sort Imports + TailwindCSS
*/
export function withTailwind(opts?: WithSortImportsOptions) {
assertDeps([
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss",
]);

const base = withSortImports(opts);

return {
...base,
plugins: [
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss",
],
pluginSearchDirs: false,
} satisfies SortImportsConfig;
}

0 comments on commit ef1565c

Please sign in to comment.