@@ -27,22 +27,6 @@ function loadLanguageOptions(languageDir: string): LanguageOptions {
2727 }
2828}
2929
30- /**
31- * Dynamically import plugins specified in the config
32- */
33- async function loadPlugins ( pluginNames : string [ ] ) : Promise < Plugin [ ] > {
34- const plugins : Plugin [ ] = [ ] ;
35- for ( const name of pluginNames ) {
36- try {
37- const plugin = await import ( name ) ;
38- plugins . push ( plugin . default ?? plugin ) ;
39- } catch ( error ) {
40- console . warn ( `Failed to load plugin "${ name } ":` , error ) ;
41- }
42- }
43- return plugins ;
44- }
45-
4630/**
4731 * Find the line containing @prettier options in the content
4832 * Returns the line index if found, -1 otherwise
@@ -121,17 +105,14 @@ for (const languageDir of languageDirs) {
121105 const filename = path . basename ( file ) ;
122106
123107 it ( filename , async ( ) => {
124- // Load plugins inside the test
125- const languagePlugins = await loadPlugins ( [ ...plugins ] ) ;
126-
127108 const content = readFileSync ( file , "utf-8" ) ;
128109 const fileOptions = parsePrettierOptions ( content ) ;
129110 const codeToFormat = getContentWithoutOptionsLine ( content ) ;
130111
131112 const formatted = await prettier . format ( codeToFormat , {
132113 ...restOptions ,
133114 ...fileOptions ,
134- plugins : [ embed , ...languagePlugins ] ,
115+ plugins : [ embed , ...plugins ] ,
135116 filepath : file ,
136117 } ) ;
137118
0 commit comments