Skip to content

Excluding ArrowFunctionExpression in CallExpressions reporting as errors #1195

@martiensk

Description

@martiensk

Expected behavior

When using the rule jsdoc/require-jsdoc with contexts with :not(CallExpression) > ArrowFunctionExpression, the plugin should not trigger an error on Vue lifecycle hooks (or setTimeout).

Actual behavior

An error is triggered.

ESLint Config

"jsdoc/require-jsdoc": [
  "error", 
  {
    "contexts": [
      ":not(CallExpression) > ArrowFunctionExpression"
    ],
    "require": {
      "ArrowFunctionExpression":false,
      "FunctionDeclaration": true,
      "MethodDefinition": true,
      "FunctionExpression": true
    }
  }
]

ESLint sample

setTimeout(() => {}, 10);
// Or in the case of Vue
onMounted(() => {
    initScrollTriggerAnimation();
});

Environment

  • Node version: 18.18.0
  • ESLint version 8.53.0
  • eslint-plugin-jsdoc version: 48.0.4

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions