1010 * Callback called when loading a config.
1111 * @param {Error | undefined } error
1212 * Error if something happened.
13- * @param {Result | undefined } [result]
13+ * @param {ConfigResult | undefined } [result]
1414 * Result.
1515 * @returns {undefined }
1616 * Nothing.
1717 *
18+ * @typedef ConfigResult
19+ * Resolved configuration.
20+ * @property {string | undefined } filePath
21+ * File path of found configuration.
22+ * @property {Array<PluginTuple> } plugins
23+ * Resolved plugins.
24+ * @property {Settings } settings
25+ * Resolved settings.
26+ *
1827 * @callback ConfigTransform
1928 * Transform arbitrary configs to our format.
2029 * @param {any } config
7079 * List of plugins and presets (optional).
7180 * @property {Settings | undefined } [settings]
7281 * Shared settings for parsers and compilers (optional).
73- *
74- * @typedef Result
75- * Resolved configuration.
76- * @property {string | undefined } filePath
77- * File path of found configuration.
78- * @property {Settings } settings
79- * Resolved settings.
80- * @property {Array<PluginTuple> } plugins
81- * Resolved plugins.
82- *
8382 */
8483
8584import assert from 'node:assert/strict'
@@ -184,7 +183,7 @@ export class Configuration {
184183 this . given = { plugins : options . plugins , settings : options . settings }
185184 this . create = this . create . bind ( this )
186185
187- /** @type {FindUp<Result > } */
186+ /** @type {FindUp<ConfigResult > } */
188187 this . findUp = new FindUp ( {
189188 create : this . create ,
190189 cwd : options . cwd ,
@@ -228,12 +227,12 @@ export class Configuration {
228227 * File value.
229228 * @param {string | undefined } filePath
230229 * File path.
231- * @returns {Promise<Result | undefined> }
230+ * @returns {Promise<ConfigResult | undefined> }
232231 * Result.
233232 */
234233 async create ( buf , filePath ) {
235234 const options = { cwd : this . cwd , prefix : this . pluginPrefix }
236- /** @type {Result } */
235+ /** @type {ConfigResult } */
237236 const result = { filePath : undefined , plugins : [ ] , settings : { } }
238237 const extname = filePath ? path . extname ( filePath ) : undefined
239238 const loader =
@@ -283,7 +282,7 @@ export class Configuration {
283282 */
284283async function loadScriptOrModule ( _ , filePath ) {
285284 // Assume it’s a config.
286- const result = /** @type {Result } */ (
285+ const result = /** @type {ConfigResult } */ (
287286 await loadFromAbsolutePath ( pathToFileURL ( filePath ) . href , this . cwd )
288287 )
289288 return result
@@ -305,7 +304,7 @@ async function loadJson(buf, filePath) {
305304 const data = parseJson ( String ( buf ) , filePath )
306305
307306 // Assume it’s a config.
308- const result = /** @type {Result } */ (
307+ const result = /** @type {ConfigResult } */ (
309308 this . packageField && path . basename ( filePath ) === 'package.json'
310309 ? data [ this . packageField ]
311310 : data
@@ -315,7 +314,7 @@ async function loadJson(buf, filePath) {
315314}
316315
317316/**
318- * @param {Result } target
317+ * @param {ConfigResult } target
319318 * Result to merge into.
320319 * @param {PresetSupportingSpecifiers } raw
321320 * Raw found config.
0 commit comments