@@ -17,6 +17,13 @@ function clearCache() {
1717 clearEditorconfigCache ( ) ;
1818}
1919
20+ /**
21+ @param {string } file
22+ @param {{
23+ editorconfig?: boolean,
24+ useCache?: boolean,
25+ }} options
26+ */
2027function loadEditorconfig ( file , options ) {
2128 if ( ! file || ! options . editorconfig ) {
2229 return ;
@@ -26,6 +33,17 @@ function loadEditorconfig(file, options) {
2633 return loadEditorconfigForFile ( file , { shouldCache } ) ;
2734}
2835
36+ /**
37+ @param {string } file
38+ @param {{
39+ useCache?: boolean,
40+ config?: string | URL
41+ }} options
42+ @returns {{
43+ config: any,
44+ configFile: string,
45+ } | void }
46+ */
2947async function loadPrettierConfig ( file , options ) {
3048 const shouldCache = options . useCache ;
3149 let configFile = options . config ;
@@ -45,6 +63,10 @@ async function loadPrettierConfig(file, options) {
4563 return { config, configFile } ;
4664}
4765
66+ /**
67+ @param {string | URL } fileUrlOrPath
68+ @param {* } options
69+ */
4870async function resolveConfig ( fileUrlOrPath , options ) {
4971 options = { useCache : true , ...options } ;
5072 const filePath = toPath ( fileUrlOrPath ) ;
@@ -74,6 +96,9 @@ async function resolveConfig(fileUrlOrPath, options) {
7496 return merged ;
7597}
7698
99+ /**
100+ @param {string | URL } fileUrlOrPath
101+ */
77102async function resolveConfigFile ( fileUrlOrPath ) {
78103 const directory = fileUrlOrPath
79104 ? path . dirname ( path . resolve ( toPath ( fileUrlOrPath ) ) )
0 commit comments