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), Arazzo v1.0, as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.45k stars 234 forks source link

Importing fixed version of OAS ruleset #2444

Open OllieTho opened 1 year ago

OllieTho commented 1 year ago

Describe the bug I was directed to raise this as an issue by @P0lip

I'm attempting to pin a specific version of spectral's OAS ruleset and have it work in both spectral cli and StopLight studio. Previously when importing this into StopLight studio I get an error about the spectral-functions package attempting to be imported when it already exists. Now it displays the following:

Module "https://unpkg.com/@stoplight/spectral-rulesets@1.14.1/dist/oas/index.js" that is marked with 'syntheticNamedExports: "moduleExports"' needs an explicit export named "moduleExports" that does not reexport an unresolved named export of the same module.

To Reproduce Import the oas ruleset into your .spectral.yaml file.

extends:
  - https://unpkg.com/@stoplight/spectral-rulesets@1.14.1/dist/oas/index.js

Expected behavior I would like to be able to use a specific version of the OAS ruleset to maintain project uptime in case an update requires changes or a service outage prevents us from reaching npm or other providers.