avajs/ava

Provide type definitions for the JS configuration files.

Offen

#3.042 geöffnet am 02.06.2022

 (3 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)JavaScript (1.408 Forks)batch import
enhancementhelp wantedscope:typescript

Repository-Metriken

Stars
 (20.600 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide