Skip to content

missingPlaceholders

Reports context.report() calls missing data for message placeholders.

✅ This rule is included in the flint logical presets.

When reporting linting issues, it’s common to include dynamic data in the message using placeholders.

const ruleCreator: any
ruleCreator
.
any
createRule
(
const _: any
_
, {
messages: {
messagesId: {
primary: string;
secondary: string[];
suggestions: string[];
};
}
messages
: {
messagesId: {
primary: string;
secondary: string[];
suggestions: string[];
}
messagesId
: {
primary: string
primary
: "This is a message with a {{placeholder}}",
secondary: string[]
secondary
: [""],
suggestions: string[]
suggestions
: [""],
},
},
function setup(context: RuleContext): void
setup
(
context: RuleContext
context
:
type RuleContext = /*unresolved*/ any
RuleContext
) {
context: RuleContext
context
.
any
report
({
message: string
message
: "messagesId",
});
},
});

This rule is not configurable.

Made with ❤️‍🔥 around the world by the Flint team and contributors.