-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
area: repository toolingconcerning ease of contributionconcerning ease of contributioncore-teamissues which must be handled by Mocha's core teamissues which must be handled by Mocha's core team
Description
Tooling Suggestion Checklist
- I have tried restarting my IDE and the issue persists.
- I have pulled the latest
main
branch of the repository. - I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
- I have searched for related issues and issues with the
faq
label, but none matched my issue. - I want to provide a PR to resolve this
Overview
Mocha defines all code types with JSDoc comments in .js
files right now. For example, this is how PluginDefinition
is declared:
Lines 1309 to 1316 in 945d6e3
/** | |
* An object making up all necessary parts of a plugin loader and aggregator | |
* @typedef {Object} PluginDefinition | |
* @property {string} exportName - Named export to use | |
* @property {string} [optionName] - Option name for Mocha constructor (use `exportName` if omitted) | |
* @property {PluginValidator} [validate] - Validator function | |
* @property {PluginFinalizer} [finalize] - Finalizer/aggregator function | |
*/ |
That type block becomes https://mochajs.org/api/global#PluginDefinition.
We'd like to move to .d.ts
files for declaring these typedefs for a few reasons:
- It's a cleaner, less verbose, more readable syntax
- It makes 🚀 Feature: TypeScript .d.ts type declarations #4154 easier
- It makes 🛠️ Repo: Lint/validate JSDoc #4228 easier
- It makes 📝 Docs: Migrate
/api
docs or an equivalent from the old site to the new one #5309 easier
Additional Info
We're not committing to converting existing *.js
files to *.ts
- runtime source code will stay in JS-land for now. That's a separate discussion.
mark-wiemer
Metadata
Metadata
Assignees
Labels
area: repository toolingconcerning ease of contributionconcerning ease of contributioncore-teamissues which must be handled by Mocha's core teamissues which must be handled by Mocha's core team