Repository navigation
docs: fix correctness issues in error codes, CLI defaults, and config docs - #5860
Conversation
|
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
@mostafaNazari702 thanks for the PR :) please do review CONTRIBUTING.md when you can. Additionally, I've added a quick explainer in the backing issue (#5528). As much as we know about the project, it's critical that our changes to the docs are accurate, and it takes time for us to manually verify a lot of these edge cases. If you could add your own examples in the form of PR comments or GitHub Gists to support these changes, it'd go a long way in getting this PR merged :)
That said, three of the five files were easy to validate, so if you could create two quick examples we'd be able to merge this promptly!
Also, please run npm run format:fix when you have a chance. We are working on #5856 in the meantime :)
Thanks again!
456e2d6 to
22c690b
Compare
mark-wiemer
left a comment
There was a problem hiding this comment.
Won't merge until we get the go-ahead from Josh :) thank you for this!
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
Looks great - I verified this matches up the code & #5397. Thanks so much @mostafaNazari702! 🔥
PR Checklist
status: accepting prs(@mark-wiemer checked this box)Overview
Fixes several documentation correctness issues across 5 pages, each verified against the current source code.
Error codes (
features/error-codes.mdx): The table listed 7 of the 16 error codes defined in error-constants.mjs. Added the 9 missing codes (ERR_MOCHA_FATAL,ERR_MOCHA_FORBIDDEN_EXCLUSIVITY,ERR_MOCHA_INSTANCE_ALREADY_DISPOSED,ERR_MOCHA_INSTANCE_ALREADY_RUNNING,ERR_MOCHA_INVALID_PLUGIN_DEFINITION,ERR_MOCHA_INVALID_PLUGIN_IMPLEMENTATION,ERR_MOCHA_MULTIPLE_DONE,ERR_MOCHA_TIMEOUT,ERR_MOCHA_UNPARSABLE_FILE) in alphabetical order.CLI
--extensiondefault (running/cli.mdx): Prose said the default wasjs. The actual default is["js", "cjs", "mjs"]per mocharc.json. Updated the description and the usage example accordingly.Config file priority list (
running/configuring.mdx): The numbered priority list was missing.mocharc.cjs(highest precedence) and.mocharc.mjs. Updated to match theCONFIG_FILESarray in config.js exactly.Compiler deprecation page (
explainers/compilers-deprecation.mdx): Stated Mocha "only loads.jsfiles" by default. Updated to reflect the actual defaults (.js,.cjs, and.mjs).ESM support limitations (
explainers/nodejs-native-esm-support.mdx): Stated the configuration file "can only be a CommonJS file (.mocharc.jsor.mocharc.cjs)". This is incorrect — YAML and JSON config formats are also supported. Corrected the bullet to accurately describe the JavaScript config format requirement and point readers to the configuring page.