Skip to main content

disallow-invalid-remark-plugin-tuples

Disallow invalid tuple entries in top-level Remark plugins arrays.

Rule detailsโ€‹

Remark plugin tuples must start with a plugin function or a string package specifier. Empty tuples, tuples that start with an options object, and tuples that start with scalar values cannot identify the plugin that should receive the options.

โŒ Incorrectโ€‹

export default {
plugins: [[]],
};
export default {
plugins: [[{ heading: "contents" }]],
};

โœ… Correctโ€‹

export default {
plugins: [["remark-toc", { heading: "contents" }]],
};
import remarkToc from "remark-toc";

export default {
plugins: [[remarkToc, { heading: "contents" }]],
};

Fixer behaviorโ€‹

This rule does not autofix because the missing plugin specifier cannot be inferred from the tuple options.

When not to use itโ€‹

Disable this rule only when a generated config intentionally uses a custom tuple shape that another build step rewrites before Remark loads it.