Analyzer
Bug fixed
-
Fix #1748. Now for the following case we won't provide an unsafe fix for the
noNonNullAssertion
rule:x[y.z!];
Contributed by @ah-yu
CLI
New features
- Add a new command
biome migrate prettier
. The command will read the file.prettierrc
/prettier.json
and.prettierignore
and map its configuration to Biome's one.
Due to the different nature of.prettierignore
globs and Biome's globs, it's highly advised to make sure that those still work under Biome.
Bug fixes
-
Don't process files under an ignored directory.
Previously, Biome processed all files in the traversed hierarchy,
even the files under an ignored directory.
Now, it completly skip the content of ignored directories. -
Fix #1508 by excluding deleted files from being processed. Contributed by @ematipico
-
Fix #1173. Fix the formatting of a single instruction with commented in a control flow body to ensure consistency. Contributed by @mdm317
-
Fix overriding of
javascript.globals
. Contributed by @arendjr -
Fix a bug where syntax rules weren't run when pulling the diagnostics. Now Biome will emit more parsing diagnostics, e.g.
check.js:1:17 parse/noDuplicatePrivateClassMembers ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Duplicate private class member "#foo" > 1 │ class A { #foo; #foo } │ ^^^^
Contributed by @ematipico
Configuration
Editors
Bug fixes
- Fix a regression where ignored files where formatted in the editor. Contributed by @ematipico
- Fix a bug where syntax rules weren't run when pulling the diagnostics. Now Biome will emit more parsing diagnostics, e.g.
Contributed by @ematipicocheck.js:1:17 parse/noDuplicatePrivateClassMembers ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Duplicate private class member "#foo" > 1 │ class A { #foo; #foo } │ ^^^^
Formatter
New features
-
Biome now allows to format the
package.json
file. This is now the default behaviour and users can remove their workarounds.
If you rely on other tools to formatpackage.json
, you'll have to ignore it via configuration. Contributed by @pattrickrice -
New formatter option
attributePosition
that have similar behavior as PrettiersingleAttributePerLine
#1706. Contributed by @octoshikari -
Add partial for
.astro
files. Biome is able to format the frontmatter of the Astro files. Contributed by @ematipico--- - statement ( ); + statement(); --- <div></div>
Bug fixes
-
Fix #1039. Check unicode width instead of number of bytes when checking if regex expression is a simple argument. Contributed by @kalleep
This no longer breaks.
s(/🚀🚀/).s().s();
-
Fix #1218, by correctly preserving empty lines in member chains. Contributed by @ah-yu
JavaScript APIs
Linter
New features
-
Add the rule noSkippedTests, to disallow skipped tests:
describe.skip("test", () => {}); it.skip("test", () => {});
Contributed by @ematipico
-
Add the rule noFocusedTests, to disallow skipped tests:
describe.only("test", () => {}); it.only("test", () => {});
Contributed by @ematipico
-
Add rule useSortedClasses, to sort CSS utility classes:
- <div class="px-2 foo p-4 bar" /> + <div class="foo·bar·p-4·px-2" />
Contributed by @DaniGuardiola
Enhancements
-
noUselessTernary now provides unsafe code fixes. Contributed by @vasucp1207
-
noApproximativeNumericConstant now provides unsafe code fixes and handle numbers without leading zero and numbers with digit separators.
The following numbers are now reported as approximated constants.
3.14_15; // PI .4342; // LOG10E
Contributed by @Conaclos
-
noPrecisionLoss no longer reports number with extra zeros.
The following numbers are now valid.
.1230000000000000000000000; 1230000000000000000000000.0;
Contributed by @Conaclos
Bug fixes
-
Fix #1651. noVar now ignores TsGlobalDeclaration. Contributed by @vasucp1207
-
Fix #1640. useEnumInitializers code action now generates valid code when last member has a comment but no comma. Contributed by @kalleep
-
Fix #1653. Handle a shorthand value in
useForOf
to avoid the false-positive case. Contributed by @togami2864 -
Fix #1656. useOptionalChain code action now correctly handles logical and chains where methods with the same name are invoked with different arguments:
- tags·&&·tags.includes('a')·&&·tags.includes('b') + tags?.includes('a') && tags.includes('b')
Contributed by @lucasweng
-
Fix #1704. Convert
/
to escaped slash\/
to avoid parsing error in the result of autofix. Contributed by @togami2864 -
Fix#1697. Preserve leading trivia in autofix of suppression rules. Contributed by @togami2864
-
Fix#603. Trim trailing whitespace to avoid double insertion. Contributed by @togami2864
Parser
Bug fixes
-
Fix #1728. Correctly parse the global declaration when the
{
token is on the line following theglobal
keyword.Now the following code is correctly parsed:
declare global { } declare module foo { global { } }
Contributed by @ah-yu
-
Fix #1730. Correctly parse
delete
expressions with operands that are not simple member expressions.delete(a.b); delete console.log(1); delete(() => {});
Contributed by @printfn
What's Changed
Other changes
- Better diagnostics error when a user tries to format code that has parsing diagnostics. by @shoaibkh4n in #1732
- fix(website): fix typo on analyzer page by @gc in #1739
- ci: update node-version to 20 by @unvalley in #1740
- feat(css_parser): parse font_feature_values by @unvalley in #1455
- feat(css_parser): CSS Parser nesting #1664 by @denbezrukov in #1741
- feat(css_formatter): CSS nesting by @denbezrukov in #1746
- chore: fix typo by @togami2864 in #1751
- fix js-api wasm peer dep versions by @si14 in #1756
- chore: add funding section to README.md by @ematipico in #1760
- feat(biome_js_analyze): noReExportAll by @mdm317 in #1761
- feat(lint/noRestrictedImports): add rule by @anonrig in #1723
- chore(lint/noImplicitAnyLet): reword diagnostic by @Aeolun in #1677
- feat(project): support
biome.jsonc
by @ematipico in #1530 - chore: Bump actions/cache by @m-nakamura145 in #1767
- docs(reference/vscode): fix setting value by @nhedger in #1778
- chore: add @anonrig to maintainers by @anonrig in #1780
- feat(lint/noConsole): add rule by @anonrig in #1771
- chore: upgrade to rust 1.76.0 by @anonrig in #1779
- docs(website): Add copy button for commands by @eyubkh in #1783
- Add myself to CONTRIBUTING.md as maintainer by @DaniGuardiola in #1787
- refactor(website): improving website's inconsistant import alias ('../') to a streamline perfect alias ('@/') to reduce the complication and easy to understand. by @shoaibkh4n in #1785
- feat(website): Custom Scroll Bar by @shoaibkh4n in #1796
- docs: fix
options
link foruseExhaustiveDependencies
linter rule by @autarc in #1755
New Contributors
- @shoaibkh4n made their first contribution in #1732
- @octoshikari made their first contribution in #1712
- @si14 made their first contribution in #1756
- @Aeolun made their first contribution in #1677
- @m-nakamura145 made their first contribution in #1767
- @eyubkh made their first contribution in #1783
- @autarc made their first contribution in #1755
Full Changelog: cli/v1.5.3-nightly.6cbf1c7...cli/v1.5.3-nightly.d2858ee