Skip to main content

require-v4-remove-legacy-post-build-head-attribute-for-ssg-worker-threads

Require future.v4.removeLegacyPostBuildHeadAttribute when faster ssgWorkerThreads are enabled.

Targeted pattern scopeโ€‹

This rule focuses on docusaurus.config.* files.

It validates the documented dependency between:

  • ssgWorkerThreads: true
  • future.v4.removeLegacyPostBuildHeadAttribute: true

inside:

  • future.faster
  • future.experimental_faster

What this rule reportsโ€‹

This rule reports faster config that enables ssgWorkerThreads without also enabling the required v4 future flag.

Why this rule existsโ€‹

Docusaurus documents ssgWorkerThreads as depending on future.v4.removeLegacyPostBuildHeadAttribute.

Leaving that v4 flag disabled makes the faster config internally inconsistent and blocks the optimization from being configured correctly.

โŒ Incorrectโ€‹

export default {
future: {
faster: {
ssgWorkerThreads: true,
},
},
};

โœ… Correctโ€‹

export default {
future: {
v4: {
removeLegacyPostBuildHeadAttribute: true,
},
faster: {
ssgWorkerThreads: true,
},
},
};

Behavior and migration notesโ€‹

This rule autofixes the simple static cases it can prove safely by inserting or replacing the required v4 flag.

When not to use itโ€‹

Do not use this rule if your project intentionally keeps partially migrated faster config and you do not want linting to normalize the documented dependency yet.

Rule catalog ID: R111

Further readingโ€‹