Skip to content

Commit

Permalink
chore: export Options to better assist type checking for .prettierrc.js
Browse files Browse the repository at this point in the history
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 a0a4399
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ function mergeParsers(originalParser: prettier.Parser, parserName: string) {
}

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

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

0 comments on commit a0a4399

Please sign in to comment.