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 or emitter you want to suppress is also installed
# example you use the @typespec/http/recommended ruleset and the @azure-tools/typespec-autorest emitter npm i @typespec/http @azure-tools/typespec-autorest -
Suppress all warnings generated by the ruleset
muzzle main.tsp --rule-set "@typespec/http/recommended" -m "auto-suppression" # Or for an emitter muzzle main.tsp --emiter "@azure-tools/typespec-autorest"
-
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 and the @azure-tools/typespec-autorest npm i -S @typespec/http @azure-tools/typespec-autorest -
Use the suppression method
import { parseTypeSpecAndSuppressEverything } from "@binkylabs/muzzle"; await parseTypeSpecAndSuppressEverything( { entryPoint: "path/to/main.tsp", ruleSets: ["@typespec/http/recommended"], emitters: ["@azure-tools/typespec-autorest"], message: "auto-suppression" } );
-
Install dependencies with
npm i
-
Build the library with
npm run build
-
Run unit tests with
npm run test