gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.1k stars 160 forks source link

Add support for in-line openapi #1300

Closed Virus288 closed 3 months ago

Virus288 commented 3 months ago

Motivation

I use package Swagger-Jsdoc . This plugin seems to be complaining about

/ **
* @openapi
*/

Which is used by Swagger-jsdoc, to mark openapi syntax. image

I would love for this plugin to have option to ignore jsdoc, which includes @openapi.

Sample code: https://github.com/Monsters-RPG-game/Gateway/blob/dev/src/structure/modules/user/register/router.ts Minimal eslint rules. related this issue

{
         "jsdoc/check-tag-names": 1,
         "jsdoc/check-indentation": 1
}

Current behavior

Currently plugin complains about jsdoc, which has @openapi

Desired behavior

Add some way to ignore jsdoc, which include @openapi, or add a way to ignore jsdoc blocks, which include specific tag

Alternatives considered

N/A

brettz9 commented 3 months ago

For check-tag-names, there is this option.

For check-indentation, you can either disable the rule or set this option.

For example:

"rules: {
  "jsdoc/check-tag-names": ["warn", {"definedTags": ["openapi"]}],
  "jsdoc/check-indentation": ["warn", {"excludeTags": ["openapi"]}]
}
brettz9 commented 3 months ago

Closing as that should resolve, but feel free to comment further as needed.

Virus288 commented 3 months ago

Thanks. I couldn't find it