avajs/ava

Provide type definitions for the JS configuration files.

Open

#3,042 创建于 2022年6月2日

在 GitHub 查看
 (3 评论) (4 反应) (0 负责人)JavaScript (20,600 star) (1,408 fork)batch import
enhancementhelp wantedscope:typescript

描述

Continuing https://github.com/avajs/typescript/issues/15#issuecomment-1140477835 cc @novemberborn


Summary

When a user configures AVA with JavaScript, it would be useful to have type definition. Users might consume these through JSDoc comments, or through a typed wrapper function.

Details

A wrapper function would be defined like this:

/**
 *
 * Configure AVA, with intellisense
 *
 * @param {Config} config - A configuration object
 * @returns {Config}
 */
export const defineConfig = (config) => config;

The function would be used like this:

import { defineConfig } from 'ava/config';

export default defineConfig({
  // ...
})

贡献者指南

Provide type definitions for the JS configuration files. · avajs/ava#3042 | Good First Issue