- Fix #4323, where
lint/a11y/useSemanticElement
accidentally showed recommendations forrole="searchbox"
instead ofrole="search"
Analyzer
Bug fixes
- Fix CSS parser case error,
@-moz-document url-prefix(https://example.com)
and@-moz-document domain(example.com)
are now valid. Contributed by @eryue0220 - Fix #4258, where fixed css parse error with @-moz-document url-prefix(). Contributed by @eryue0220
CLI
Bug fixes
biome migrate eslint
now correctly resolves scoped package namedeslint-config
with a path.
Contributed by @Conaclos
Configuration
Editors
Formatter
Bug fixes
- Fix #4121, don't ident a CSS selector when has leading comments. Contributed by @fireairforce
JavaScript APIs
Linter
New features
-
Add noUselessUndefined. Contributed by @unvalley
-
useFilenamingConvention accepts a new option
match
(#4105).You can now validate filenames with a regular expression.
For instance, you can allow filenames to start with%
:{ "linter": { "rules": { "style": { "useFilenamingConvention": { "level": "warn", "options": { "match": "%?(.+?)[.](.+)", "filenameCases": ["camelCase"] } } } } } }
If the regular expression captures strings, the first capture is considered to be the name of the file, and the second one to be the extensions (dot-separated values).
The name of the file and the extensions are checked againstfilenameCases
.
Given the previous configuration, the filename%index.d.ts
is valid because the first captureindex
is incamelCase
and the second captured.ts
include dot-separated values inlowercase
.
On the other hand,%Index.d.ts
is not valid because the first captureIndex
is inPascalCase
.Note that specifying
match
disallows any exceptions that are handled by the rule by default.
For example, the previous configuration doesn't allow filenames to be prefixed with underscores,
a period or a plus sign.
You need to include them in the regular expression if you still want to allow these exceptions.Contributed by @Conaclos
-
useFilenamingConvention and useNamingConvention
match
options now accept case-insensitive and case-sensitive groups.By default, the regular expression in
match
is case-sensitive.
You can now make it case-insensitive by using a case-insensitive group(?i:)
.
For example, the regular expression(?i:a)
matchesa
andA
.Contributed by @Conaclos
Enhancements
-
useExportType
anduseImportType
now ignore TypeScript declaration files (#4416). Contributed by @Conaclos -
useArrayLiterals now provides a code fix.
- const xs = new Array(); + const xs = [];
The code fix is currently marked as unsafe.
We plan to make it safe in a future release of Biome.Contributed by @Conaclos
Bug fixes
-
useArrayLiterals now reports all expressions using the
Array
constructors.Previously, the rule reported only use of the
Array
constructor in expressions statements.// This was reported new Array(); // This was not reported const xs = new Array();
Contributed by @Conaclos
Parser
Bug fixes
-
Fix #4317, setter parameter can contain a trailing comma, the following example will now parsed correctly:
export class DummyClass { set input( value: string, ) {} }
Contributed by @fireairforce
-
Fix #3836, css parser allow multiple semicolons after a declaration, the following example will now parsed correctly:
.foo { color: red;; }
Contributed by @fireairforce
-
Fix #342, js parser handle unterminated
JSX_STRING_LITERAL
properlyfunction Comp() { return ( <a rel="
-
Fix #342, js parser is no longer progressing for an invalid object
member name:({ params: { [paramName: string]: number } = {} })
Contributed by @denbezrukov
-
Fix #342, "expected a declaration as guaranteed by is_at_ts_declare_statement" error for declare interface:
declare interface
Contributed by @denbezrukov
What's Changed
Other changes
- feat(noUndeclaredDependencies): add availability restriction based on dependency type by @siketyan in #4376
- build: reduce binary size by @Jayllyz in #4437
- chore: update unicode table by @Conaclos in #4442
- chore(linter): clean up lint rules and update correct version numbers by @togami2864 in #4440
- chore: remove JS parser test generation codegen by @Conaclos in #4443
- chore(deps): update rust crate serde to 1.0.214 by @renovate in #4459
- chore(deps): update rust crate regex to 1.11.1 by @renovate in #4458
- chore(deps): update rust crate anyhow to 1.0.92 by @renovate in #4457
- chore(deps): update @biomejs packages by @renovate in #4456
- chore(deps): update softprops/action-gh-release action to v2.0.9 by @renovate in #4460
- feat: custom explanations with
--suppress
by @anthonyshew in #4343 - chore: refine README.kr.md by @StationSoen in #4110
- perf(useArrowFunction): avoid useless checks by @Conaclos in #4465
- docs: add typescript-eslint rule source for
useArrayLiterals
by @anthonyshew in #4455 - docs: update
README.kr.md
by @jsparkdev in #4468 - feat(format/grit): add formatting for lists by @branberry in #4378
- feat(grit): add formatting of more nodes by @ematipico in #4472
- fix(js_formatter): format hook with 3 arguments by @vohoanglong0107 in #4462
- refactor(analyzer): use rule name for quick fix by @ematipico in #4469
- feat: enable handling of grit files by @ematipico in #4473
- fix(grit): linting inside workspace by @ematipico in #4477
New Contributors
- @StationSoen made their first contribution in #4110
- @jsparkdev made their first contribution in #4468
Full Changelog: cli/v1.9.5-nightly.4713c52...cli/v1.9.5-nightly.ff02a0b