As noticed at wikimedia/eslint-plugin-mediawiki/pull/65 the documentation generator is fairly inflexible regarding per-rule configuration, such as not using the fixCodeExamples option (which assumes everything is javascript) or choosing a syntax highlighting other than javascript.
Proposal:
in RuleTester.run() the same tests object that includes the valid and invalid examples can also have a docgenConfig property that would override the global configuration. If not in documentation mode, the property would be deleted automatically, like the config to show or hide specific tests
Add an option to both the global config and new per-rule config to control the syntax highlighting language, defaulting to javascript like currently
As noticed at wikimedia/eslint-plugin-mediawiki/pull/65 the documentation generator is fairly inflexible regarding per-rule configuration, such as not using the
fixCodeExamples
option (which assumes everything is javascript) or choosing a syntax highlighting other than javascript.Proposal:
docgenConfig
property that would override the global configuration. If not in documentation mode, the property would be deleted automatically, like the config to show or hide specific tests