File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ async function logFileInfoOrDie(context) {
1616 const fileInfo = await getFileInfo ( path . resolve ( file ) , {
1717 ignorePath,
1818 withNodeModules,
19- plugins : plugins . length > 0 ? plugins : undefined ,
19+ plugins,
2020 resolveConfig : config !== false ,
2121 } ) ;
2222
Original file line number Diff line number Diff line change 11import { resolveConfig } from "../config/resolve-config.js" ;
2- import { loadBuiltinPlugins , loadPlugins } from "../main/plugins/index.js" ;
2+ import { loadPlugins } from "../main/plugins/index.js" ;
33import { isIgnored } from "../utils/ignore.js" ;
44import inferParser from "../utils/infer-parser.js" ;
55
@@ -54,10 +54,10 @@ async function getParser(file, options) {
5454 return config . parser ;
5555 }
5656
57- let plugins = options . plugins ?? config ?. plugins ?? [ ] ;
58- plugins = (
59- await Promise . all ( [ loadBuiltinPlugins ( ) , loadPlugins ( plugins ) ] )
60- ) . flat ( ) ;
57+ const plugins = [
58+ ... options . plugins ,
59+ ... ( await loadPlugins ( config ?. plugins ?? [ ] ) ) ,
60+ ] ;
6161
6262 return inferParser ( { plugins } , { physicalFile : file } ) ;
6363}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { closestMatch as closetLevenshteinMatch } from "leven";
1111import picocolors from "picocolors" ;
1212import * as vnopts from "vnopts" ;
1313import * as errors from "./common/errors.js" ;
14+ import getFileInfoWithoutPlugins from "./common/get-file-info.js" ;
1415import { mockable } from "./common/mockable.js" ;
1516import {
1617 clearCache as clearConfigCache ,
@@ -90,6 +91,8 @@ const inferParser = withPlugins((file, options) =>
9091 inferParserWithoutPlugins ( options , { physicalFile : file } ) ,
9192) ;
9293
94+ const getFileInfo = withPlugins ( getFileInfoWithoutPlugins ) ;
95+
9396// Internal shared with cli
9497const sharedWithCli = {
9598 errors,
@@ -132,11 +135,11 @@ export {
132135 clearCache as clearConfigCache ,
133136 format ,
134137 formatWithCursor ,
138+ getFileInfo ,
135139 getSupportInfo ,
136140 resolveConfig ,
137141 resolveConfigFile ,
138142} ;
139- export { default as getFileInfo } from "./common/get-file-info.js" ;
140143export * as doc from "./document/public.js" ;
141144export { default as version } from "./main/version.evaluate.js" ;
142145export * as util from "./utils/public.js" ;
You can’t perform that action at this time.
0 commit comments