Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: export Options to better assist type checking for .prettierrc.js #210

Merged
merged 1 commit into from Oct 7, 2023

Conversation

Aqzhyi
Copy link
Contributor

@Aqzhyi Aqzhyi commented Oct 7, 2023

This change enables developers to import the Options type in their .prettierrc.js file to assist them in making type checking on Options.

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',
}

CleanShot 2023-10-07 at 12 31 02

src/index.ts Outdated Show resolved Hide resolved
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',
}
```
Copy link
Collaborator

@danielpza danielpza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hosseinmd
Copy link
Owner

Thank you

@hosseinmd hosseinmd merged commit 085f905 into hosseinmd:master Oct 7, 2023
3 of 4 checks passed
hosseinmd pushed a commit that referenced this pull request Oct 7, 2023
…#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',
}
```
@hosseinmd
Copy link
Owner

v1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants