A muzzle for your TypeSpec linting rules. It's experimental, slightly unethical, and definitely effective.
npm install @binkylabs/muzzleWelcome 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.
1. Install the CLI with
``shell`
npm i -g @binkylabs/muzzle
1. Ensure the ruleset or emitter you want to suppress is also installed
`shell`
# example you use the @typespec/http/recommended ruleset and the @azure-tools/typespec-autorest emitter
npm i @typespec/http @azure-tools/typespec-autorest
1. Suppress all warnings generated by the ruleset
`shell
muzzle main.tsp --rule-set "@typespec/http/recommended" -m "auto-suppression"
# Or for an emitter
muzzle main.tsp --emiter "@azure-tools/typespec-autorest"
`
1. Install the package with
`shell`
npm i -S @binkylabs/muzzle
1. Ensure the ruleset you want to suppress is also installed
`shell`
# example you use the @typespec/http/recommended ruleset and the @azure-tools/typespec-autorest
npm i -S @typespec/http @azure-tools/typespec-autorest
1. Use the suppression method
`TypeScript
import { parseTypeSpecAndSuppressEverything } from "@binkylabs/muzzle";
await parseTypeSpecAndSuppressEverything(
{
entryPoint: "path/to/main.tsp",
ruleSets: ["@typespec/http/recommended"],
emitters: ["@azure-tools/typespec-autorest"],
message: "auto-suppression"
}
);
`
1. Install dependencies with
`shell`
npm i
1. Build the library with
`shell`
npm run build
1. Run unit tests with
`shell``
npm run test