Analyzer
CLI
New features
-
The command
biome migrate
now updates the$schema
if there's an outdated version. -
The commands
format
,lint
,check
andci
now accepts two new arguments:--changed
and--since
. Use these options when the VCS integration
is enabled to process only the files that were changed. Contributed by @simonxabrisbiome format --write --changed
Bug fixes
- Fix #709, by correctly parsing allow list patterns in
.gitignore
files. Contributed by @ematipico - Fix #805, by correctly parsing these kind of patterns. Contributed by @ematipico
- Fix #1117 by correctly respecting the matching. Contributed by @ematipico
- Fix #1247, Biome now prints a warning diagnostic if it encounters files that can't handle. Contributed by @ematipico
- Fix #691 and #1190, by correctly apply the configuration when computing the overrides. Contributed by @ematipico
Configuration
New features
-
Users can specify git ignore patterns inside
ignore
andinclude
properties, for example it's possible to allow list globs of files using the!
character:{ "files": { "ignore": [ "node_modules/**", "!**/dist/**" // this is now accepted and allow list files inside the `dist` folder ] } }
Editors
New features
- The LSP register formatting without the need of using dynamic capabilities from the client.
Formatter
- Fix #1169. Account for escaped strings when computing layout for assignments. Contributed by @kalleep
- Fix #1220. Avoid duplicating comments in type unions for mapped, empty object, and empty tuple types. #1240 Contributed by @faultyserver
JavaScript APIs
Linter
New features
-
Add useExportType that enforces the use of type-only exports for names that are only types. Contributed by @Conaclos
interface A {} interface B {} class C {} - export type { A, C } + export { type A, C } - export { type B } + export type { B }
-
Add useFilenamingConvention, that enforces naming conventions for JavaScript and TypeScript filenames. Contributed by @Conaclos
By default, the rule requires that a filename be in
camelCase
,kebab-case
,snake_case
, or matches the name of anexport
in the file.
The rule provides options to restrict the allowed cases. -
Add noNodejsModules, that disallows the use of Node.js modules.
-
Add useNodeImportProtocol that forces the use of the
node:
protocol when importing Node.js modules. Contributed by @2-NOW -
Add noInvalidUseBeforeDeclaration that reports variables and function parameters used before their declaration. Contributed by @Conaclos
function f() { console.log(c); // Use of `c` before its declaration. const c = 0; }
Enhancements
-
Address #959 and #1157. noEmptyInterface no longer reports empty interfaces that extend a type. Contributed by @Conaclos
This allows supporting interface augmentation in external modules as demonstrated in the following example:
interface Extension { metadata: unknown; } declare module "@external/module" { // Empty interface that extends a type. export interface ExistingInterface extends Extension {} }
Bug fixes
-
Fix #1061. noRedeclare no longer reports overloads of
export default function
. Contributed by @ConaclosThe following code is no longer reported:
export default function(a: boolean): boolean; export default function(a: number): number; export default function(a: number | boolean): number | boolean { return a; }
-
Fix #651, useExhaustiveDependencies no longer reports out of scope dependencies. Contributed by @kalleep
The following code is no longer reported:
let outer = false; const Component = ({}) => { useEffect(() => { outer = true; }, []); }
-
Fix #1191. noUselessElse now preserve comments of the
else
clause. Contributed by @ConaclosFor example, the rule suggested the following fix:
function f(x) { if (x <0) { return 0; } - // Comment - else { return x; - } }
Now the rule suggests a fix that preserves the comment of the
else
clause:function f(x) { if (x <0) { return 0; } // Comment - else { return x; - } }
-
Fix #728. useSingleVarDeclarator no longer outputs invalid code. Contributed by @Conaclos
-
Fix #1167. [useValidAriaProps] no longer reports
aria-atomic
as invalid. Contributed by @unvalley
Parser
- Fix #1077, fix issues when parsing conditional expression where parenthesized identifier was being parsed as arrow expression. Contributed by @kalleep
These cases are now properly parsed:
javascript:
a ? (b) : a => {};
typescript:
a ? (b) : a => {};
jsx:
bar ? (foo) : (<a>{() => {}}</a>);
What's Changed
Other changes
- feat(css_parser): support
@font-palette-values
by @unvalley in #1264 - chore: update justfile and resources by @ematipico in #1275
- refactor:
useNodeImportProtocol
codefix by @vasucp1207 in #1276 - docs:
noImportAssign
docs fix by @vasucp1207 in #1277 - feat(css_parser): CSS Parser: parse keyframes #1268 by @denbezrukov in #1271
- chore: update Prettier compatibility by @Conaclos in #1284
- feat(css_formatter): Basic css formatting of rules, selectors, and declarations by @faultyserver in #1256
- refactor(config): reduce size by 53% by @Conaclos in #1283
- feat: use user local data dir for lsp daemon files by @bestmike007 in #1238
- chore: move translation links on top by @ematipico in #1298
- fix(css_parser): CSS Parser: fix attribute selector and dimension by @denbezrukov in #1288
- fix(cli): only count errors for max diagnostics by @yossydev in #1248
- [Minor Doc Fix] Capitalisation in Readme by @DestroyerXyz in #1300
- readme(zh-CN): Optimize some expressions, typesetting format in Chinese and English. by @dufu1991 in #1301
- fix(css_parser): CSS Parser: unify
_list
nodes by @denbezrukov in #1304 - feat(css_formatter): all the remaining at-rules by @faultyserver in #1296
- feat(css_formatter): media and container queries by @faultyserver in #1294
- feat(css_formatter): support for pseudo selectors by @faultyserver in #1291
- chore: add myself as a core contributor by @faultyserver in #1307
- fix(service): properly merge configuration for json and css by @faultyserver in #1270
- docs: fix formatting issue by @benceHornyak in #1306
- feat(css_formatter): support for var functions by @faultyserver in #1293
- fix(css_formatter): syntax errors after parser refactoring by @faultyserver in #1308
- fix(cli): diagnostic level by @ematipico in #1299
- chore: use new logo in readme by @ematipico in #1297
New Contributors
- @bestmike007 made their first contribution in #1238
- @DestroyerXyz made their first contribution in #1300
- @benceHornyak made their first contribution in #1306
Full Changelog: cli/v1.4.1-nightly.efc084c...cli/v1.4.1-nightly.22dd4e1