-
-
Notifications
You must be signed in to change notification settings - Fork 163
Missing JSDoc param in .vue file #719
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
Comments
If you can create a minimal test case repo, there is a greater chance we can debug this. I don't know it if may relate to your Webpack or Rollup routine. |
Yes of course. Here it is. |
Using the command line, When viewing within Atom, I get an error about no Babel config file being detected, but when I add parserOptions: {
babelOptions: {
cwd: '/Users/brett',
configFile: './forJSDoc/babel.config.js'
},
parser: '@babel/eslint-parser',
sourceType: 'module',
}, ...I also just get the same error as on the command line. Perhaps this is an issue specific to your IDE. |
I will clarify what it is in the files |
Do you have Atom available to test? I'm not sure why it would be working there... What was the original IDE you were using? |
I do not have Atom, but i can set it for test. |
I'm afraid I'm rather tied up in other projects to really explore this too deeply atm myself. Hopefully someone can go to Or perhaps it can be solved by adjusting the IDE's settings, e.g., ala babel/babel-eslint#769 (comment) , in case your Hope that leads to some avenues of exploration, as I'm not really too sure at this point. |
Hi all, I'm having the very same issue when working on a Windows 10 OS. Please note that I got no problem at all when using MAC OS. Here's a sample of a file I'm trying to lint: /**
* @description My beautiful description
* @param {string} param - This is an awesome param indeed
* @return {boolean} true if not false
*/
myBeautifulMethod(param) { ... } Here's the output of my lint job:
It's like the plugin found a JSDoc block, but was totally unable to analyze its content. Just like @Holiden, If I try an
From where I stand, it looks like a bad detection of end-of-line after the Edit: |
Again, I got the very same behaviour. @Holiden Can you please confirm my lead about Windows OS? Thanks in advance |
@gcunsolo : If you can use Then, if you could reduce your code down to see whether that comment block alone in a file is sufficient to trigger the error... And if you would also try upgrading to the latest |
Thank you @brettz9 I'm currently using 33.1.1, I'll give 34.0.2 a shot and get back to you with more information, as you asked! (...and hey! Good job! We all get here to complain when there's something wrong... we never take the time to thank you all for your work!!) |
All right. This is the problem I have on OS Windows 10. |
While this doesn't look necessarily Windows specific, you might perhaps take a look at this JSDoc stripping issue referenced at https://github.com/jsdoc2md/jsdoc-to-markdown/wiki/How-to-document-TypeScript#tips--tricks |
Hi @brettz9 The "broken" rules are I confirm that For your information, I executed your unit tests and I got the following output:
Tests are passing, and yet that log concerning eslint-plugin-jsdoc/test/rules/index.js Lines 48 to 55 in 9fb6b36
As I said before, it looks like only when using Windows the plugin is able to identify a JSDoc block but totally unable to parse its content. As an additional note, I tried to play with your eslint-plugin-jsdoc/src/iterateJsdoc.js Lines 114 to 162 in 6b6d908
|
Hi @gcunsolo ,
Thanks for this info.
Yeah, I hard-coded this warning. We need to fix
Would need to take a closer look, but I would suspect Windows issues might be related to the recently discovered issue highlighted at #745 (comment) where the comment parser is dropping carriage returns. (I since reported the issue to syavorsky/comment-parser#129 and am now awaiting a reply). |
Hi @brettz9 , the issue is still happening even with syavorsky/comment-parser#129 closed. So i have made a fork to reproduce this issue on my Windows. Basically i think its all related to line endings, windows files being CRLF . fork can be found here : https://github.com/solven-eu/eslint-plugin-jsdoc/tree/reproduce_jsdoc_lint_error here a litlle details , i've done to reproduce it:
AND had to rename the name of the project to eslint-plugin-jsdoc-fork to be able to install eslint-plugin-jsdoc.. inside the project 😅 To reproduce , just launch the command BEFOREAFTERand here the logs
Hopes this can help |
Am a bit preoccupied these days; hopefully can take a look within a couple weeks time. Thanks! |
Hello, The root-cause seems not in this library, as the SourceCode object holds a token lacking \n characters. For given PR, over a
while the SourceCode text (with \r and \n escaped) is:
-> The token holds \r without their \n sibling. Over a \n files, the token is:
Is SourceLocation a babel object, or from another library? (If ESLint, all this may be related with https://github.com/vuejs/vue-eslint-parser) |
ESLint apparently consumes these (per https://eslint.org/docs/developer-guide/working-with-custom-parsers#all-nodes ), but it looks like it would come from a parser. |
I've confirmed that this is a bug, but a bug apparently with |
Just reporting back that as per vuejs/vue-eslint-parser#145 , this issue should now be fixed, and that fix was included in version 8.3.0 of Please confirm if it is working for you all. Thanks! |
Hello!
Expected behavior
It is expected that the plugin will not display a missing parameter error as they are already defined.
Actual behavior
I am getting an error about missing parameters. However, my JSDoc are filled in correctly. This is .vue file.
If use the suggested autofix, then the parameters are inserted before existing JSDoc declaration
When editing a file anywhere, errors disappear. Not always, but sometimes it works
ESLint Config
Environment
eslint-plugin-jsdoc
version: v32.3.3The text was updated successfully, but these errors were encountered: