Open
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
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