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
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
-
Fix #4323, where
lint/a11y/useSemanticElement
accidentally showed recommendations forrole="searchbox"
instead ofrole="search"
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
What's Changed
Other changes
- docs(useFilenamingConvention): add
Since <version>
for the match option by @Conaclos in #4382 - feat(restricted_glob): negated globs by @Conaclos in #4377
- refactor(restricted_glob): add Eq impls by @Conaclos in #4388
- test: use
insta
for JS parser by @ematipico in #4386 - feat(lint): add
useGoogleFontPreconnect
rule by @kaioduarte in #4185 - feat(graphql_analyze): useNamedOperation by @vohoanglong0107 in #4337
- fix(lsp): emit text edits when formatting by @ematipico in #4398
- chore(deps): update rust crate anyhow to 1.0.91 by @renovate in #4405
- chore(deps): update @biomejs packages by @renovate in #4400
- chore(deps): update dependency dprint to v0.47.5 by @renovate in #4401
- chore(deps): update github-actions by @renovate in #4402
- chore(deps): update pnpm to v9.12.3 by @renovate in #4403
- feat: move biome_lsp/converters to a separate crate by @Princesseuh in #4407
- chore(deps): remove once_cell crate by @Conaclos in #4409
- chore(deps): patch updates by @Conaclos in #4410
- chore(deps): update by @Conaclos in #4411
- chore: new crate and actions enhancements by @ematipico in #4419
- chore: rename action to use the internal naming convention by @ematipico in #4420
- refactor(assists): add action options by @Conaclos in #4422
- chore(deps): update rust crate rustc-hash to v2 by @renovate in #4284
- refactor: order lint rules in rage output by @Conaclos in #4431
- refactor(useFilenamingConvention): order suggested filenames by @Conaclos in #4432
- refactor(lint,actions): avoid duplicated filters by @Conaclos in #4434
New Contributors
- @Princesseuh made their first contribution in #4407
Full Changelog: cli/v1.9.5-nightly.92879ae...cli/v1.9.5-nightly.4713c52