avajs/ava

Provide type definitions for the JS configuration files.

開放

#3,042 建立於 2022年6月2日

 (3 則留言) (4 個反應) (0 位負責人)JavaScript (1,408 個分叉)batch import
enhancementhelp wantedscope:typescript

倉庫指標

星標
 (20,600 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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({
  // ...
})

貢獻者指南