@inlang/message-lint-rule
Advanced tools
Comparing version 1.3.0 to 1.4.0
import type { Message } from "@inlang/message"; | ||
import type { LanguageTag } from "@inlang/language-tag"; | ||
import { Translatable } from "@inlang/translatable"; | ||
import { type Static } from "@sinclair/typebox"; | ||
import { type Static, type TObject } from "@sinclair/typebox"; | ||
import type { JSONObject } from "@inlang/json-types"; | ||
@@ -26,3 +26,3 @@ import { ExternalProjectSettings, type ProjectSettings } from "@inlang/project-settings"; | ||
* type RuleSettings = { | ||
* storagePath: string | ||
* filePath: string | ||
* } | ||
@@ -35,3 +35,4 @@ * | ||
*/ | ||
export type MessageLintRule<ExternalSettings extends Record<keyof ExternalProjectSettings, JSONObject> | unknown = unknown> = Static<typeof MessageLintRule> & { | ||
export type MessageLintRule<ExternalSettings extends Record<keyof ExternalProjectSettings, JSONObject> | unknown = unknown> = Omit<Static<typeof MessageLintRule>, "settingsSchema"> & { | ||
settingsSchema?: TObject; | ||
run: (args: { | ||
@@ -47,10 +48,16 @@ message: Message; | ||
}; | ||
export declare const MessageLintRule: import("@sinclair/typebox").TObject<{ | ||
export declare const MessageLintRule: TObject<{ | ||
id: import("@sinclair/typebox").TTemplateLiteral<[import("@sinclair/typebox").TLiteral<`messageLintRule.${string}.${string}`>]>; | ||
displayName: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{ | ||
displayName: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TIntersect<[TObject<{ | ||
en: import("@sinclair/typebox").TString; | ||
}>, import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>]>]>; | ||
description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{ | ||
description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TIntersect<[TObject<{ | ||
en: import("@sinclair/typebox").TString; | ||
}>, import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>]>]>; | ||
/** | ||
* Tyepbox is must be used to validate the Json Schema. | ||
* Github discussion to upvote a plain Json Schema validator and read the benefits of Typebox | ||
* https://github.com/inlang/monorepo/discussions/1503 | ||
*/ | ||
settingsSchema: import("@sinclair/typebox").TOptional<TObject<{}>>; | ||
}>; | ||
@@ -57,0 +64,0 @@ /** |
@@ -9,2 +9,8 @@ import { Translatable } from "@inlang/translatable"; | ||
description: Translatable(Type.String()), | ||
/** | ||
* Tyepbox is must be used to validate the Json Schema. | ||
* Github discussion to upvote a plain Json Schema validator and read the benefits of Typebox | ||
* https://github.com/inlang/monorepo/discussions/1503 | ||
*/ | ||
settingsSchema: Type.Optional(Type.Object({}, { additionalProperties: true })), | ||
}); |
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { Type } from "@sinclair/typebox"; | ||
import { MessageLintRule } from "./interface.js"; | ||
@@ -3,0 +4,0 @@ const id = "messageLintRule.placeholder.name"; |
{ | ||
"name": "@inlang/message-lint-rule", | ||
"type": "module", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"license": "Apache-2.0", | ||
@@ -32,3 +32,3 @@ "publishConfig": { | ||
"peerDependencies": { | ||
"@sinclair/typebox": "^0.31.0" | ||
"@sinclair/typebox": "^0.31.17" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { Type } from "@sinclair/typebox" | ||
import { MessageLintRule } from "./interface.js" | ||
@@ -3,0 +4,0 @@ |
import type { Message } from "@inlang/message" | ||
import type { LanguageTag } from "@inlang/language-tag" | ||
import { Translatable } from "@inlang/translatable" | ||
import { Type, type Static } from "@sinclair/typebox" | ||
import { Type, type Static, type TObject } from "@sinclair/typebox" | ||
import type { JSONObject } from "@inlang/json-types" | ||
@@ -34,3 +34,3 @@ import { | ||
* type RuleSettings = { | ||
* storagePath: string | ||
* filePath: string | ||
* } | ||
@@ -43,5 +43,8 @@ * | ||
*/ | ||
export type MessageLintRule< | ||
ExternalSettings extends Record<keyof ExternalProjectSettings, JSONObject> | unknown = unknown | ||
> = Static<typeof MessageLintRule> & { | ||
> = Omit<Static<typeof MessageLintRule>, "settingsSchema"> & { | ||
settingsSchema?: TObject | ||
run: (args: { | ||
@@ -61,2 +64,8 @@ message: Message | ||
description: Translatable(Type.String()), | ||
/** | ||
* Tyepbox is must be used to validate the Json Schema. | ||
* Github discussion to upvote a plain Json Schema validator and read the benefits of Typebox | ||
* https://github.com/inlang/monorepo/discussions/1503 | ||
*/ | ||
settingsSchema: Type.Optional(Type.Object({}, { additionalProperties: true })), | ||
}) | ||
@@ -63,0 +72,0 @@ |
Sorry, the diff of this file is not supported yet
9577
185