@binkylabs/muzzle
v1.2.2
Published
A muzzle for your TypeSpec linting rules. It's experimental, slightly unethical, and definitely effective.
Maintainers
Readme
TypeSpec Muzzle
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.
Usage
CLI
Install the CLI with
npm i -g @binkylabs/muzzleEnsure 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-autorestSuppress 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"
API
Install the package with
npm i -S @binkylabs/muzzleEnsure 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-autorestUse 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" } );
Debugging
Install dependencies with
npm iBuild the library with
npm run buildRun unit tests with
npm run test
