Skip to content

jsdoc/valid-types for |undefined properties #63

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

Closed
kevinoid opened this issue May 31, 2021 · 3 comments
Closed

jsdoc/valid-types for |undefined properties #63

kevinoid opened this issue May 31, 2021 · 3 comments
Labels

Comments

@kevinoid
Copy link

Cross post of gajus/eslint-plugin-jsdoc#749 per gajus/eslint-plugin-jsdoc#747 (comment)

Expected behavior

jsdoc/valid-types does not warn for {message: string|undefined}.

Actual behavior

index.js:2:0: Syntax error in type: {message: string|undefined} [Warning/jsdoc/valid-types]

ESLint Config

{
  "extends": [
    "plugin:jsdoc/recommended"
  ]
}

ESLint sample

/**
 * @param {{message: string|undefined}} options Options.
 */
function MyError(options) {
}

Environment

  • Node version: v12.21.0
  • ESLint version v7.27.0
  • eslint-plugin-jsdoc version: v35.1.1 or v35.1.0

Additional Info

I confirmed the issue does not occur with [email protected] or earlier.

Thanks again,
Kevin

@simonseyock
Copy link
Member

Thanks for reporting this, it is likely an issue with the operator precedence.

simonseyock pushed a commit that referenced this issue Jun 1, 2021
## [1.0.3](v1.0.2...v1.0.3) (2021-06-01)

### Bug Fixes

* Precedence for key value pairs in objects ([ebde3ca](ebde3ca)), closes [#63](#63)
@simonseyock
Copy link
Member

🎉 This issue has been resolved in version 1.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kevinoid
Copy link
Author

kevinoid commented Jun 1, 2021

Looks great. Thanks @simonseyock!

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

2 participants