Skip to main content

Config Authoring

Bridge execution solves "how to run Remark from ESLint." Config authoring rules solve "how to keep Remark config files maintainable over time."

Why config quality rules matterโ€‹

In larger repositories, Remark config drift usually appears as:

  • duplicated plugins entries
  • inconsistent plugin array ordering
  • hidden relative path assumptions
  • plugin packages referenced by config but missing from package metadata

The config rule set keeps config files deterministic and review-friendly.

Start with recommended, then strengthen incrementally.

A practical progression:

  1. Shape rules such as prefer-remark-plugins-array.
  2. Deduplication and sorting rules for stable diffs.
  3. Package and path checks for monorepo safety.

Authoring conventions that scaleโ€‹

1. Keep plugins explicitโ€‹

2. Keep arrays deterministicโ€‹

Use sorting rules to minimize merge churn:

3. Avoid local relative plugins by defaultโ€‹

Local Remark plugins can be valid, but they are harder to package, share, and resolve consistently in monorepos.

Use disallow-remark-relative-plugin-paths unless local plugins are an explicit project policy.

Monorepo tipsโ€‹

  • Keep configFile explicit when packages need different Remark behavior.
  • Avoid relative plugin path assumptions between packages.
  • Validate package dependencies where Remark config references plugins.

Migration strategy for existing reposโ€‹

  1. Enable config rules in warning mode first.
  2. Apply autofixes and sorting.
  3. Resolve remaining hard violations in batches.
  4. Promote to error once baseline debt is cleared.