Skip to content

pluginRuleOrdering

Reports Flint plugin rules arrays that are not sorted alphabetically.

✅ This rule is included in the flint stylisticStrict presets.

Flint plugin rules arrays are generally sorted alphabetically by rule identifier. Keeping them in order makes it easier to add new rules without deciding where they belong first. Alphabetically sorted lists are also easier to search through.

import { createPlugin } from "@flint.fyi/core";
import firstRule from "./rules/firstRule.ts";
import secondRule from "./rules/secondRule.ts";
export const plugin = createPlugin({
name: "Example",
rules: [secondRule, firstRule],
});

This rule is not configurable.

If a flint plugin’s rules array is intentionally grouped or ordered for some other tooling, you may prefer to disable this rule.

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