Skip to content

linter: Add test script to CI to enforce config option documentation for all rules #15095

@connorshea

Description

@connorshea

See #14743 for the overall effort around this. We want to make sure that auto-generated documentation is ensured by CI, so new rules cannot regress on this behavior.

Similar to rule_configuration_test.rs, a test script should be added to ensure that all rules with configuration options have a Configuration block in their rule page on the website.

We can start by enforcing this per-plugin, with all oxc/ rules that have config options now being fully documented, and hopefully soon import, jest, promise, jsdoc, and vue also being able to be added to the enforced plugins in the next few weeks. react-perf and nextjs are also fully covered at this point, I believe.

I'm not 100% sure how this should be done, ideally it'd be able to enforce that every config option in the file has corresponding documentation, but at the least we should enforce for now that all rules which define a from_configuration function also have a Configuration section in their generated website page. doc_page.rs may also be a useful reference for implementing this.

Eventually, we'll want to apply this to all rules across all plugins, but that'll require the completion of #14743 first.

Plugins we can currently enforce this check on:

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions