Ignore option on the require-jsdoc rule
See original GitHub issue( I am using “eslint”: “^1.9.0” )
It will be nice if we can specify functions that the rule will ignore. e.g. the render
function on React components is kinda obvious what is doing and a comment block is not really needed.
It will be nice if we can have something like:
"require-jsdoc" : [ 2,
{
"require":
{
"FunctionDeclaration" : true,
"MethodDefinition" : true,
"ClassDeclaration" : true
},
"ignore":
{
"render" : true,
"constructor" : true,
"componentDidMount" : true
}
}],
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:7 (2 by maintainers)
Top Results From Across the Web
require-jsdoc - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >eslint-plugin-require-jsdoc-except - npm
A modified version of the built-in eslint rule require-jsdoc that allows you to exclude certain methods from requiring a JSDoc.
Read more >How to disable require-jsdoc eslint in webpack - Stack Overflow
I used the .eslintrc.json file and added this under rules. "require-jsdoc" : 0. I don't use webpack. Hope this helps.
Read more >netsells/eslint-plugin-require-jsdoc-except - npm package - Snyk
A modified version of the built-in eslint rule require-jsdoc that allows you to exclude certain methods from requiring a JSDoc.
Read more >README.md
```js // `.eslintrc.js` { rules: { 'jsdoc/require-example': [ // The Error level should be `error`, `warn`, or `off` (or 2, 1, or 0)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This would be a pretty big hack and would likely have a lot of false positives, so I don’t think we can implement this.
There is a quite new plugin for that: https://github.com/MaienM/eslint-plugin-require-jsdoc-except
It even supports regular expressions so you can add e.g. ignore rule
"/^_.*$/"
which will ignore require-jsdoc for all method/functions starting with_
.