@@ -10,9 +10,6 @@ export type BiomeLoaderOptions = {
1010 alwaysFormat ?: boolean ;
1111} ;
1212
13- // Track warnings shown per file extension to avoid spam
14- const shownWarnings = new Set < string > ( ) ;
15-
1613export default function createBiomeLoader (
1714 options : BiomeLoaderOptions ,
1815) : ILoader < string , string > {
@@ -63,7 +60,11 @@ async function formatDataWithBiome(
6360 // Load config from biome.json/biome.jsonc if exists
6461 configPath = await findBiomeConfig ( filePath ) ;
6562 if ( ! configPath && ! options . alwaysFormat ) {
66- return data ; // Skip if no config and not forced
63+ console . log ( ) ;
64+ console . log (
65+ `⚠️ Biome config not found for ${ path . basename ( filePath ) } - skipping formatting` ,
66+ ) ;
67+ return data ;
6768 }
6869
6970 if ( configPath ) {
@@ -84,19 +85,18 @@ async function formatDataWithBiome(
8485
8586 return formatted . content ;
8687 } catch ( error ) {
87- const ext = path . extname ( filePath ) ;
88-
89- // Only show warning once per file extension
90- if ( ! shownWarnings . has ( ext ) ) {
91- shownWarnings . add ( ext ) ;
92-
93- console . log ( ) ;
94- console . log (
95- `⚠️ Biome does not support ${ ext } files - skipping formatting` ,
96- ) ;
97-
98- if ( error instanceof Error && error . message ) {
99- console . log ( ` ${ error . message } ` ) ;
88+ // Extract error message from Biome
89+ const errorMessage =
90+ error instanceof Error
91+ ? error . message || ( error as any ) . stackTrace ?. toString ( ) . split ( "\n" ) [ 0 ]
92+ : "" ;
93+
94+ if ( errorMessage ?. includes ( "does not exist in the workspace" ) ) {
95+ // Biome says "file does not exist in workspace" for unsupported formats - skip
96+ } else {
97+ console . log ( `⚠️ Biome skipped ${ path . basename ( filePath ) } ` ) ;
98+ if ( errorMessage ) {
99+ console . log ( ` ${ errorMessage } ` ) ;
100100 }
101101 }
102102
0 commit comments