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

Fix: jsdoc dependency rules changed #50452 #50590

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/eslint-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

### Breaking Changes

- The bundled eslint-plugin-jsdoc dependency has been updated from requiring ^39.6.9 to requiring ^44.2.3 ([#50590](https://github.com/WordPress/gutenberg/pull/50590)) :
- Removes `jsdoc/newline-after-description` rule in favor of `jsdoc/tag-lines` with option `startLines: 0` for "never" and `startLines: 1` for "always". Defaults now to `startLines: 0`
- Removes `dropEndLines: true` from `jsdoc/tag-lines` in favor of option `endLines: 0`
- Drops `jsdoc/tag-lines` rule's `noEndLines: true` in favor of `applyToEndTag: false`

## 14.6.0 (2023-05-10)

### Enhancement
Expand Down
11 changes: 9 additions & 2 deletions packages/eslint-plugin/configs/jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ module.exports = {
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-yields': 'off',
'jsdoc/tag-lines': 'off',
'jsdoc/tag-lines': [
1,
'any',
{
startLines: 0,
Copy link
Member

Choose a reason for hiding this comment

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

It reports 3401 errors with startLines set to 0. Most of them are incorrect, as we don't want to enforce to have no blank lines after the description in JSDoc:

Screenshot 2023-05-15 at 10 17 33

The simplest way would be setting startLines to null. Then it reports 14 errors fixable with a single npm run lint:js:fix call.

endLines: 0,
applyToEndTag: false,
},
],
'jsdoc/no-multi-asterisks': [
'error',
{ preventAtMiddleLines: false },
Expand All @@ -127,7 +135,6 @@ module.exports = {
'jsdoc/check-values': 'off',
'jsdoc/empty-tags': 'error',
'jsdoc/implements-on-classes': 'error',
'jsdoc/newline-after-description': 'error',
'jsdoc/require-param': 'error',
'jsdoc/require-param-name': 'error',
'jsdoc/require-param-type': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jsdoc": "^39.6.9",
"eslint-plugin-jsdoc": "^44.2.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^3.3.0",
"eslint-plugin-react": "^7.27.0",
Expand Down