Skip to main content

disallow-unknown-remark-config-properties

Disallow unknown top-level properties in Remark config objects.

Rule detailsโ€‹

Remark config files loaded through remark-cli and unified-engine use top-level plugins and settings properties. Other top-level keys are usually typos or config copied from another Markdown integration, such as Gatsby's resolve shape or ESLint's extends.

โŒ Incorrectโ€‹

export default {
plugin: ["remark-gfm"],
};
export default {
extends: ["remark-preset-lint-recommended"],
};

โœ… Correctโ€‹

export default {
plugins: ["remark-gfm"],
};
export default {
settings: {
bullet: "*",
},
};

Fixer behaviorโ€‹

The fixer renames the common singular typos plugin and setting when the matching canonical key is not already present. Other unknown properties are reported without a fix because the intended Remark behavior is ambiguous.

When not to use itโ€‹

Disable this rule if a separate tool transforms your config object before Remark receives it and that transform intentionally uses custom top-level properties.