Skip to content

Commit

Permalink
chore: export Options to better assist type checking for .prettierrc.…
Browse files Browse the repository at this point in the history
…js (#210)

Developers can now import the Options type in the .prettierrc.js file for TypeScript type checking.

For example,

```
// import prettier-plugin-jsdoc Options
/** @type {import('prettier-plugin-jsdoc').Options} } */
const prettierPluginJsdocOptions = {
  jsdocCapitalizeDescription: false,
}

// import prettier Options
/** @type {import('prettier').Options} */
const config = {
  plugins: ['prettier-plugin-jsdoc'],
  ...prettierPluginJsdocOptions,
  singleAttributePerLine: true,
  arrowParens: 'always',
}
```
  • Loading branch information
Aqzhyi committed Oct 7, 2023
1 parent 76ed2e7 commit 085f905
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Expand Up @@ -233,6 +233,7 @@ function mergeParsers(originalParser: prettier.Parser, parserName: string) {
}

export { options, parsers, defaultOptions };
export type Options = Partial<JsdocOptions>;

function normalizeOptions(options: prettier.ParserOptions & JsdocOptions) {
if (options.jsdocCommentLineStrategy) {
Expand Down

0 comments on commit 085f905

Please sign in to comment.