@inlang/message-lint-rule
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -5,3 +5,4 @@ import type { Message } from "@inlang/message"; | ||
import { type Static } from "@sinclair/typebox"; | ||
import { type ProjectSettings } from "@inlang/project-settings"; | ||
import type { JSONObject } from "@inlang/json-types"; | ||
import { ExternalProjectSettings, type ProjectSettings } from "@inlang/project-settings"; | ||
export type MessageLintLevel = Static<typeof MessageLintLevel>; | ||
@@ -19,6 +20,21 @@ export declare const MessageLintLevel: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"error">, import("@sinclair/typebox").TLiteral<"warning">]>; | ||
}; | ||
export type MessageLintRule = Static<typeof MessageLintRule> & { | ||
/** | ||
* The message lint rule API. | ||
* | ||
* You can use your own settings by extending the type with a generic: | ||
* | ||
* ```ts | ||
* type RuleSettings = { | ||
* storagePath: string | ||
* } | ||
* | ||
* const messageLintRule: MessageLintRule<{ | ||
* "messageLintRule.your.id": RuleSettings | ||
* }> | ||
* ``` | ||
*/ | ||
export type MessageLintRule<ExternalSettings extends Record<keyof ExternalProjectSettings, JSONObject> | unknown = unknown> = Static<typeof MessageLintRule> & { | ||
run: (args: { | ||
message: Message; | ||
settings: ProjectSettings; | ||
settings: ProjectSettings & ExternalSettings; | ||
report: (args: { | ||
@@ -25,0 +41,0 @@ messageId: Message["id"]; |
import { Translatable } from "@inlang/translatable"; | ||
import { Type } from "@sinclair/typebox"; | ||
import { _MessageLintRuleId, _MessageLintRuleLevel, } from "@inlang/project-settings"; | ||
import { _MessageLintRuleId, _MessageLintRuleLevel, ExternalProjectSettings, } from "@inlang/project-settings"; | ||
export const MessageLintLevel = _MessageLintRuleLevel; | ||
@@ -5,0 +5,0 @@ export const MessageLintRule = Type.Object({ |
{ | ||
"name": "@inlang/message-lint-rule", | ||
"type": "module", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"license": "Apache-2.0", | ||
@@ -25,5 +25,6 @@ "publishConfig": { | ||
"dependencies": { | ||
"@inlang/json-types": "*", | ||
"@inlang/language-tag": "*", | ||
"@inlang/message": "*", | ||
"@inlang/project-settings": "2.1.0", | ||
"@inlang/project-settings": "*", | ||
"@inlang/translatable": "*" | ||
@@ -30,0 +31,0 @@ }, |
@@ -5,5 +5,7 @@ import type { Message } from "@inlang/message" | ||
import { Type, type Static } from "@sinclair/typebox" | ||
import type { JSONObject } from "@inlang/json-types" | ||
import { | ||
_MessageLintRuleId, | ||
_MessageLintRuleLevel, | ||
ExternalProjectSettings, | ||
type ProjectSettings, | ||
@@ -26,6 +28,23 @@ } from "@inlang/project-settings" | ||
export type MessageLintRule = Static<typeof MessageLintRule> & { | ||
/** | ||
* The message lint rule API. | ||
* | ||
* You can use your own settings by extending the type with a generic: | ||
* | ||
* ```ts | ||
* type RuleSettings = { | ||
* storagePath: string | ||
* } | ||
* | ||
* const messageLintRule: MessageLintRule<{ | ||
* "messageLintRule.your.id": RuleSettings | ||
* }> | ||
* ``` | ||
*/ | ||
export type MessageLintRule< | ||
ExternalSettings extends Record<keyof ExternalProjectSettings, JSONObject> | unknown = unknown | ||
> = Static<typeof MessageLintRule> & { | ||
run: (args: { | ||
message: Message | ||
settings: ProjectSettings | ||
settings: ProjectSettings & ExternalSettings | ||
report: (args: { | ||
@@ -32,0 +51,0 @@ messageId: Message["id"] |
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
8441
14
163
6
5
+ Added@inlang/json-types@*
+ Added@inlang/project-settings@2.4.2(transitive)
- Removed@inlang/project-settings@2.1.0(transitive)
Updated@inlang/project-settings@*