-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
jsdoc/valid-types Rule Errors when namepath contains readonly
(all lowercase)
#813
Comments
I'd prefer we get any tests added to |
I ran into this error today in a typedef. We have an object with a property named "readonly" and I get this error. ESLint v7.7.0 Example: /**
* An object interface
* @typedef {Object} FooBar
* @property {boolean} readonly
* @property {boolean} private
* @property {boolean} public
* @property {boolean} constant
*/ Error:
My only workaround was to disable the /* eslint-disable jsdoc/valid-types */
/**
* An object interface
* @typedef {Object} FooBar
* @property {boolean} readonly
* @property {boolean} private
* @property {boolean} public
* @property {boolean} constant
*/
/* eslint-enable */ |
The issue is being tracked at You might try surrounding the item in quotes and see if that provides a temporary resolution. |
Thanks, I noticed that after posting. Quotes do not resolve the issue. |
Expected behavior
The following should be valid and should not generate an error.
Actual behavior
Errors with: "Syntax error in namepath: params.readonly jsdoc/valid-types".
ESLint Config
ESLint sample
Environment
eslint-plugin-jsdoc
version: 37.2.0Possible Cause
I believe the cause of this is due to the following PR: jsdoc-type-pratt-parser/jsdoc-type-pratt-parser#98
Although the cause may be due to the parser (I filed an issue there too (jsdoc-type-pratt-parser/jsdoc-type-pratt-parser#104)), I'm thinking it would be good to improve the tests here to help catch some of these errors.
The text was updated successfully, but these errors were encountered: