microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
92f7dc8654f967aa9e489c2e8da384f922f00a4b

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

packages/library-linter/src/lib.ts

23lines · modecode

1import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
2
3export const libDef = {
4 name: "@typespec/library-linter",
5 diagnostics: {
6 "missing-namespace": {
7 severity: "warning",
8 messages: {
9 default: paramMessage`${"type"} '${"name"}' is not in a namespace. This is bad practice for a published library.`,
10 },
11 },
12 "missing-signature": {
13 severity: "warning",
14 messages: {
15 default: paramMessage`Decorator function $${"decName"} is missing a decorator declaration. Add "extern dec ${"decName"}(...args);" to the library tsp.`,
16 },
17 },
18 },
19} as const;
20const lib = createTypeSpecLibrary(libDef);
21export const { reportDiagnostic } = lib;
22
23export type OpenAPILibrary = typeof lib;
24