Welcome to the TypeSpec Muzzle project. This project aims to provide tooling to suppress TypeSpec linting issues from the CLI. This is useful if you want to establish a baseline suppression in your TypeSpec definition without having to disable the rules entirely. For example when starting a new project from an OpenAPI import, or trying to enable new rules with existing infringements on an existing projects.
-
Install the CLI with
npm i -g @binkylabs/muzzle
-
Ensure the ruleset you want to suppress is also installed
# example you use the @typespec/http/recommended ruleset npm i @typespec/http -
Suppress all warnings generated by the ruleset
muzzle main.tsp --rule-set "@typespec/http/recommended" -m "auto-suppression"
-
Install the package with
npm i -S @binkylabs/muzzle
-
Ensure the ruleset you want to suppress is also installed
# example you use the @typespec/http/recommended ruleset npm i -S @typespec/http -
Use the suppression method
import { parseTypeSpecAndSuppressEverything } from "@binkylabs/muzzle"; await parseTypeSpecAndSuppressEverything( { entryPoint: "path/to/main.tsp", ruleSets: ["@typespec/http/recommended"], message: "auto-suppression" } );
-
Install dependencies with
npm i
-
Build the library with
npm run build
-
Run unit tests with
npm run test