#Lint Rule API Introduction
The Lint Rule API provides a straightforward way to implement linting rules for messages in your project
. The API can be categorized into two main blocks: meta
and lint logic
.
The core of the lint rule is encapsulated in the lint logic
, a function named message
. This function receives a message along with additional contextual information, such as languageTags
, sourceLanguageTag
, and a report
callback. The message
function is where you define and execute your custom linting logic, analyzing message variants and reporting issues as needed.
import type { MessageLintRule } from "@inlang/message-lint-rule";
import { id, displayName, description } from "../marketplace-manifest.json";
export const yourLintRule: MessageLintRule = {
id,
displayName,
description,
message: ({ message: { id, variants }, languageTags, sourceLanguageTag, report }) => {
// Your custom lint rule logic goes here
// You can analyze message variants and report issues if necessary
},
};