-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support typed configuration via an ava.config.ts
file
#15
Comments
Yea, this is the kicker. AVA needs to first resolve the configuration, to then determine whether to load I suppose we could resolve But we'd have to compile the file which is another complication. I'm not sure it's worth it, as nice as it would be to have a type definition for the config. |
@novemberborn I believe that there are two separate ideas here. Firstly, whether ava should support |
For the record, AVA 4 now lists |
How would this work in practice, in JS files? |
JSDoc comments. I use them very often. /**
* @type {import('ava').Config}
*/
const config = {};
module.exports = config; |
A little awkward, but it would then provide auto-completion and whatnot so that's cool! PR welcome, even if it's an incomplete starting point. Note that we also support a config factory. |
That said, this needs to be added in https://github.com/avajs/ava. |
There's also another solution that I've seen a couple places (vite, nextjs). AVA would export a |
Importing |
It'd be useful if we could use TypeScript to define our Ava configurations via an
ava.config.ts
file.Ideally, we'd be able to structure them like so:
Webpack supports similar functionality with
webpack.config.ts
files (although I believets-node
is required for those).The text was updated successfully, but these errors were encountered: