Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stoplight/spectral-ruleset-bundler

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/spectral-ruleset-bundler

## Options

  • 1.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
312K
increased by9.42%
Maintainers
2
Weekly downloads
 
Created
Source

@stoplight/spectral-ruleset-bundler

Options

  • plugins - any other Rollup.js plugin, i.e. a minifier.
  • target:
    • node - a preset suitable for the Node.js runtime
    • browser - a preset tailored to Browsers
    • runtime - a preset you want to use if you want to bundle & execute the ruleset at the runtime
  • format - supported values are: esm, commonjs, iife.
  • treeshake - whether to enable tree shaking. False by default.

Bolded options are required.

Loading YAML/JSON Ruleset

// spectral.mjs
import * as fs from "node:fs";
import { fileURLToPath } from "node:url";
import * as path from "node:path";
import { Spectral } from "@stoplight/spectral-core";
import { bundleAndLoadRuleset } from "@stoplight/spectral-ruleset-bundler/with-loader";
import { fetch } from "@stoplight/spectral-runtime";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const s = new Spectral();
s.setRuleset(await bundleAndLoadRuleset(path.join(__dirname, ".spectral.yaml"), { fs, fetch }));

// lint as usual

FAQs

Package last updated on 13 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc