stoplightio / spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.43k stars 235 forks source link

Breaking change detected with release of @stoplight/json@3.21.0 #2500

Closed pavelkornev closed 1 year ago

pavelkornev commented 1 year ago

Describe the bug Spectral returns different set of messages depending on the transitive dependency version @stoplight/json.

To Reproduce

  1. Checkout repository - https://github.com/pavelkornev/spectral-example
  2. Run npm ci
  3. Run npm start: Screenshot 2023-07-07 at 09 46 30
  4. Run npm ls @stoplight/json (v3.20.3 is used everywhere): Screenshot 2023-07-07 at 09 48 41
  5. Remove node_modules: rm -rf node_modules(!important)
  6. Remove package-lock.json: rm package-lock.json
  7. Run npm install
  8. Run npm ls @stoplight/json (now NPM resolves some deps to the new version, some to the old): Screenshot 2023-07-07 at 09 52 30
  9. Run npm start Screenshot 2023-07-07 at 09 54 07

Now we have 2 messages for the same problem instead of 1 as before.

Please note, that the usage of different versions of @stoplight/json at the same time by different packages is not the root issue here. I have enforced all packages to use the latest v3.21.0 and I have the same outcome — 2 messages instead of 1. So, the root cause is most likely related to this PR — https://github.com/stoplightio/json/pull/122.

Expected behavior Spectral must return 1 message as before, not 2.

P0lip commented 1 year ago

@pavelkornev https://github.com/stoplightio/spectral/pull/2501 will fix it

pavelkornev commented 1 year ago

@P0lip thank you! Is it possible to release today? or when is the next planned release?

stoplight-bot commented 1 year ago

:tada: This issue has been resolved in version 1.18.2 :tada:

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket: