disable import sorting in one file? #7483
-
is there a way to disable import sorting in one file? we have a barrel file that has been sorted by hand by one of our engineers and they would like to retain that sort order in only that file. they've tried the lint ignore syntax for import sorting but it didn't stop it from automatically sorting. we do have sort on save enabled in VSCode / cursor settings for the time being i have suggested that they save without formatting/fixing/sorting and then use the lint ignore syntax to see how far that takes the problem but i haven't had feedback yet on if it worked (we run |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can disable import sorting using a suppression comment on the first import: // biome-ignore assist/source/organizeImports: organized by hand
import B from "b";
import A from "a"; As demonstrated in the playground, the imports are not organized (See the "Analyzer Fixes" tab). Otherwise, you can add an override in the biome config file and disable {
"overrides": [{
"includes": ["src/barrel-file.js"],
"assist": {
"actions": {
"organizeImports": "off"
}
}
}]
}
Do you mean |
Beta Was this translation helpful? Give feedback.
You can disable import sorting using a suppression comment on the first import:
As demonstrated in the playground, the imports are not organized (See the "Analyzer Fixes" tab).
Otherwise, you can add an override in the biome config file and disable
organizeImports
for a given file:Do you mean
biome lint --write
?biome lint
andbiome format
doesn't organize imports.biome check
does.If you run
biome check --write
, it wil…