Skip to content

Commit

Permalink
feat(prettier): addprettier-plugin-jsdoc (#10)
Browse files Browse the repository at this point in the history
Adds the prettier plugin `prettier-plugin-jsdoc`.
  • Loading branch information
mheob authored Jul 25, 2022
1 parent b9e3a2b commit ad1fc96
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-wasps-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mheob/prettier-config": minor
---

Add `prettier-plugin-jsdoc` to the prettier config.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"@changesets/cli": "^2.24.0",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@mheob/eslint-config": "workspace:0.0.0",
"@mheob/prettier-config": "workspace:0.0.0",
"@mheob/eslint-config": "workspace:*",
"@mheob/prettier-config": "workspace:*",
"eslint": "^8.20.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
Expand Down
9 changes: 8 additions & 1 deletion packages/prettier-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,25 @@ This configuration uses the
plugin and set these styles:

```js
const jsDocPlugin = require('prettier-plugin-jsdoc');
const sortImports = require('@trivago/prettier-plugin-sort-imports');

/** @type {import('prettier').Config} */
module.exports = {
plugins: [sortImports],
plugins: [jsDocPlugin, sortImports],
arrowParens: 'always',
endOfLine: 'lf',
printWidth: 100,
proseWrap: 'always',
importOrder: ['^node:', '<THIRD_PARTY_MODULES>', '^[./]'],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
singleQuote: true,
semi: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,

overrides: [
{
files: '*.{yaml,yml}',
Expand Down
3 changes: 2 additions & 1 deletion packages/prettier-config/index.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const jsDocPlugin = require('prettier-plugin-jsdoc');
const sortImports = require('@trivago/prettier-plugin-sort-imports');

/** @type {import('prettier').Config} */
module.exports = {
plugins: [sortImports],
plugins: [jsDocPlugin, sortImports],
arrowParens: 'always',
endOfLine: 'lf',
printWidth: 100,
Expand Down
3 changes: 2 additions & 1 deletion packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"lint": "TIMING=1 eslint src/**/*.ts* --fix"
},
"dependencies": {
"@trivago/prettier-plugin-sort-imports": "^3.3.0"
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"prettier-plugin-jsdoc": "^0.3.38"
},
"devDependencies": {
"@mheob/eslint-config": "workspace:*",
Expand Down
Loading

0 comments on commit ad1fc96

Please sign in to comment.