-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
Expected behavior
When using the rule jsdoc/require-jsdoc with contexts with CallExpression:not(*) and MemberExpression, the plugin should not trigger an error on functions calls.
Actual behavior
Errors are triggered on functions calls.
ESLint config
module.exports = {
root: true,
globals: {
'console': false
},
parser: 'babel-eslint',
extends: ['plugin:jsdoc/recommended'],
rules: {
'jsdoc/require-jsdoc': ['error', {
contexts: [
'CallExpression:not(*)', // should prevent the next line (also tried `'CallExpression:not(*) > MemberExpression'` but wasn't sure about this one)
'MemberExpression', // <- false positive
'VariableDeclaration',
],
}],
},
};ESLint sample
class Test {
constructor() {
this.memberExpression = 'member'; // good
this.aFunc(); // wrong: should not be triggered
const aVariable = 'variable'; // good
}
/**
* @returns {void}
*/
aFunc = () => {}
}CLI sample
eslint myfile.js
Environment
- Node version: 12.16.3
- ESLint version: 6.8.0
- eslint-plugin-jsdoc version: 30.0.3