Skip to content

How to restore require-jsdoc behavior from ^46.8.2 #1292

@krutoo

Description

@krutoo

Hi, today I upgraded eslint-plugin-jsdoc from ^46.8.2 to ^48.11.0

I noticed that now require-jsdoc rule works differently.

Previously I used this config for require-jsdoc:

{
  'require-jsdoc': [
    'error',
    {
      require: {
        ArrowFunctionExpression: true,
        ClassDeclaration: true,
        FunctionDeclaration: true,
        FunctionExpression: true,
        MethodDefinition: true,
      },
    },
  ]
};

In old version this code provides error:

// Error: requires JSDoc (and its ok, i need it)
export const foo = () => {
  return 1;
};

export const bar = {
  // Error: requires JSDoc (and its ok, i need it)
  hello () {
    return 'hi'
  },

  // No error here (and its ok, i dont need it here)
  baz: () => {
    // Error: requires JSDoc (and its ok, i need it)
    const id = a => a;

    return id(2);
  },
};

But now all this arrow functions don't provides errors about JSDoc missing.

How can I restore behavior from version ^46.8.2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions