Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed lint with 18.1.3 #437

Closed
zhaparoff opened this issue Nov 20, 2019 · 4 comments
Closed

Failed lint with 18.1.3 #437

zhaparoff opened this issue Nov 20, 2019 · 4 comments
Labels

Comments

@zhaparoff
Copy link

Hi,

Seems like 18.1.3 broke the lint for me again.

Code:

/**
 * Parses query string to object containing URL parameters
 * 
 * @param queryString 
 * Input string
 * 
 * @returns
 * Object containing URL parameters
 */
export function parseQueryString(queryString: string): { [key: string]: string } {    // <-- Line 10 that fails

}

Running linter produces the following error:

TypeError: Cannot read property 'endsWith' of undefined
Occurred while linting C:\_Work\Code\WebResources\src\helpers\queryString.ts:10
    at Object.report.line [as fix] (C:\_Work\Code\WebResources\node_modules\eslint-plugin-jsdoc\dist\rules\newlineAfterDescription.js:46:80)
    at normalizeFixes (C:\_Work\Code\WebResources\node_modules\eslint\lib\linter\report-translator.js:176:28)
    at C:\_Work\Code\WebResources\node_modules\eslint\lib\linter\report-translator.js:278:49
    at Object.report (C:\_Work\Code\WebResources\node_modules\eslint\lib\linter\linter.js:905:41)
    at report (C:\_Work\Code\WebResources\node_modules\eslint-plugin-jsdoc\dist\iterateJsdoc.js:388:13)
    at _default.iterateAllJsdocs (C:\_Work\Code\WebResources\node_modules\eslint-plugin-jsdoc\dist\rules\newlineAfterDescription.js:44:7)
    at C:\_Work\Code\WebResources\node_modules\eslint-plugin-jsdoc\dist\iterateJsdoc.js:444:13
    at Array.forEach (<anonymous>)
    at Program (C:\_Work\Code\WebResources\node_modules\eslint-plugin-jsdoc\dist\iterateJsdoc.js:433:20)
    at C:\_Work\Code\WebResources\node_modules\eslint\lib\linter\safe-emitter.js:45:58

For me looks like similar to #433

Environment is pretty the same:
OS: Win10 x64 1709
node: 12.13.0
npm: 6.13.1

@brettz9
Copy link
Collaborator

brettz9 commented Nov 20, 2019

I have added 18.1.4 which addresses a regression of 18.1.3 (though I wouldn't have thought that would be the case here), but you might see if that fixed things anyways, as I don't see anything else that 18.1.3 would have broken.

If that doesn't work, it would help if you could add the following lines above line 44 in your dist\rules\newlineAfterDescription.js and let me know what is logged:

      console.log('sourceLines', sourceLines);
      console.log('description', jsdoc.description.split('\n'));

@zhaparoff
Copy link
Author

It still fails for me with 18.1.4 =(

Output you've requested:

sourceLines [
  '/**\r',
  ' * Parses query string to object containing URL parameters\r',
  ' * \r',
  ' * @param queryString \r',
  ' * Input string\r',
  ' * \r',
  ' * @returns\r',
  ' * Object containing URL parameters\r',
  ' */'
]
description [
  '\r',
  'Parses query string to object containing URL parameters\r',
  '\r'
]

@brettz9
Copy link
Collaborator

brettz9 commented Nov 25, 2019

Thanks, that helped a lot. Found another issue in the process of fixing this one too.

@gajus
Copy link
Owner

gajus commented Nov 25, 2019

🎉 This issue has been resolved in version 18.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants