Eslint-plugin-jsdoc: TypeError: ancestorNodes.flatMap is not a function

Created on 3 Jun 2020  路  3Comments  路  Source: gajus/eslint-plugin-jsdoc

Expected behavior



Runs without error like in v27.0.0

Actual behavior



The following error is occuring: ERROR TypeError: ancestorNodes.flatMap is not a function

The error occurs on this line https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/rules/noUndefinedTypes.js#L80

ESLint Config

module.exports = {
    parser: 'vue-eslint-parser',
    extends: [
        'plugin:vue/recommended',
        'eslint:recommended',
        '@vue/typescript/recommended',
        'plugin:jsdoc/recommended'
    ],
    rules: {
        'jsdoc/require-param': 0,
        'jsdoc/require-returns': 0
    },
    parserOptions: {
        parser: '@typescript-eslint/parser'
    },
    plugins: [
        'jsdoc'
    ]
};

I pasted a simplified version of the config used were I encounter the bug but I think it will occur even without the Vue.js configuration

ESLint sample


This seems to occur in any place

/** v-debounce directive */
export const debounce: DirectiveOptions = {};

Environment

  • Node version: 10.20.1
  • ESLint version: 6.8.0
  • eslint-plugin-jsdoc version: 27.0.1
bug released

Most helpful comment

@brettz9 Thank you for fixing this issue so quickly! 馃槂

All 3 comments

Ugh, had forgotten flatMap isn't supported on older Node. Fixed.

To prevent this in the future, @gajus, I think eslint-plugin-compat would have caught such a case if you were open to adding it.

:tada: This issue has been resolved in version 27.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

@brettz9 Thank you for fixing this issue so quickly! 馃槂

Was this page helpful?
0 / 5 - 0 ratings