Closed fab1o closed 2 years ago
Currently, contexts
—the option which indicates where a rule should apply—is not available globally. That would be a dupe of #857.
But if your issue is simply that you do not want reporting of errors for the fact that a JSDoc block is missing above toString()
, you can get that with the likes of adding this object option:
{
contexts: [
'MethodDefinition[key.name!="toString"]',
'Property[key.name!="toString"]',
]
}
Just be sure that you don't have MethodDefinition: true
set in the require
option so that the MethodDefinition
in contexts
is the only one that applies.
Closing as that should resolve (or be a dupe), but feel free to comment further as necessary, and if necessary, I can reopen.
Motivation
Is there a way to globally except certain functions from being ruled?
Let say I have many different classes/files with a function
toString(){}
and I don't want ignore all these functions.Is there a way I could do:
Or is there a way to accomplish that with the
jsdoc/require-jsdoc
rule?Current behavior
Desired behavior
Alternatives considered