question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[valid-jsdoc] Syntax error with curried function as return value

See original GitHub issue

Tell us about your environment

  • ESLint Version: v4.16.0
  • Node Version: v9.0.0
  • npm Version: v5.5.1
  • yarn Version: v1.3.2

What parser (default, Babel-ESLint, etc.) are you using?

Babel-ESLint

Please show your full configuration:

Configuration

module.exports = {
  extends: ['eslint:recommended'],
  plugins: ['filenames'],
  env: {
    es6: true,
    node: true,
  },
  parserOptions: {
    ecmaVersion: 8,
    sourceType: 'script',
    ecmaFeatures: {
      experimentalObjectRestSpread: true,
    },
  },
  rules: {
    'array-callback-return': 1,
    'arrow-body-style': 1,
    'arrow-parens': 0,
    camelcase: 2,
    curly: [1, 'all'],
    'dot-notation': 1,
    'eol-last': 0,
    eqeqeq: 1,
    'linebreak-style': 1,
    'lines-around-directive': 1,
    'new-cap': [1, { properties: false }],
    'newline-after-var': 1,
    'newline-before-return': 1,
    'no-alert': 0,
    'no-array-constructor': 2,
    'no-case-declarations': 2,
    'no-console': 1,
    'no-const-assign': 1,
    'no-debugger': 1,
    'no-dupe-class-members': 2,
    'no-extra-semi': 0,
    'no-irregular-whitespace': 2,
    'no-iterator': 1,
    'no-lone-blocks': 0,
    'no-loop-func': 2,
    'no-mixed-spaces-and-tabs': 0,
    'no-new-object': 1,
    'no-nested-ternary': 2,
    'no-param-reassign': 1,
    'no-template-curly-in-string': 2,
    'no-underscore-dangle': [2, { allow: ['_id', '_rev'] }],
    'no-unexpected-multiline': 0,
    'no-unneeded-ternary': [1, { defaultAssignment: false }],
    'no-unused-vars': [2, { ignoreRestSiblings: true }],
    'no-useless-concat': 1,
    'no-useless-constructor': 1,
    'no-useless-escape': 1,
    'no-var': 1,
    'object-shorthand': 1,
    'one-var': [2, 'never'],
    'prefer-arrow-callback': 1,
    'prefer-const': 1,
    'prefer-rest-params': 1,
    'prefer-template': 1,
    strict: 2,
    'valid-jsdoc': 2,
    //////////////////////
    // Filenames
    //////////////////////
    'filenames/match-exported': 2,
  },
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

I wrote a JSDoc for a curried function.

/**
 * Return true if some of the children props exist.
 *
 * @param {string} pkgProp Parent prop
 * @return {(props: string | Array<string>) => boolean} 
 */
const hasPkgSubProp = pkgProp => props =>
  hasPkgProp(arrify(props).map(p => `${pkgProp}.${p}`));
eslint /* folders */ --fix

What did you expect to happen?

To not mark the JSDoc as an error.

What actually happened? Please include the actual, raw output from ESLint.

image

It marks the JSDoc as if it had a syntax error. Is this correct? VSCode doesn’t complain, by the way.

And there is this only issue on the jsdoc repo https://github.com/jsdoc3/jsdoc/issues/1286

Thank you for your work!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Oct 24, 2018

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to be implemented after 90 days tend to never be implemented, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

0reactions
lgraziani2712commented, Jul 24, 2018

I’m… not exactly sure if this is really a valid jsdoc: I cannot find any documentation related to it.

Here is the only issue related, and it’s still open: https://github.com/jsdoc3/jsdoc/issues/1286#issuecomment-341911947

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix this ESLint/JSDoc syntax error? - Stack Overflow
Through much trial and error, it appears that Doctrine doesn't like the default values on the arguments. var doctrine = require("doctrine"); ...
Read more >
valid-jsdoc - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Documentation - TypeScript for Functional Programmers
To get an error when TypeScript produces an any , use "noImplicitAny": true , or "strict": true in tsconfig.json . Structural typing. Structural...
Read more >
Jsdoc And Vscode: Documenting A Function Passed As An ...
I just found this issue with no solution: jsdoc/jsdoc#1286 I would like to hear Ramda experts Support for curried functions jsdoc/jsdoc#1286.
Read more >
Curried Function Declaration Syntax Has Been Removed
Returns the next function has patterns in tight loops, ... Valid-jsdoc Syntax error with curried function as plot value eslinteslint9949. Lightweight syntax.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found