Releases: biomejs/biome
CLI v1.7.1
Editors
Bug fixes
- Fix #2403 by printing the errors in the client console. Contributed by @ematipico
Formatter
Bug fixes
-
Add parentheses for the return expression that has leading multiline comments. #2504. Contributed by @ah-yu
-
Correctly format dangling comments of continue statements. #2555. Contributed by @ah-yu
Linter
Bug fixes
- Fix case where
jsxRuntime
wasn't being respected byuseImportType
rule (#2473).Contributed by @arendjr - Fix #2460, where the rule
noUselessFragments
was crashing the linter in some cases. Now cases like these are correctly handled:Contributed by @ematipicocallFunction(<>{bar}</>)
- Fix #2366, where
noDuplicateJsonKeys
incorrectly computed the kes to highlight. Contributed by @ematipico
Enhancements
- The rule
noMisplacedAssertions
now considers valid callingexpect
insidewaitFor
:Contributed by @ematipicoimport { waitFor } from '@testing-library/react'; await waitFor(() => { expect(111).toBe(222); });
What's Changed
Other changes
- fix(lint/noBarrelFile): rule source by @Conaclos in #2464
- refactor(bench): update import statement and module handling in run.js by @chansuke in #2471
- docs: fix missing punctuation and typo by @uncenter in #2477
- fix: missing "--apply" option in the command example by @t-shiratori in #2479
- chore: tidy up dependencies by @ematipico in #2480
- chore(ci): add repository dispatch workflow by @Sec-ant in #2442
- chore: fix some typos in comments by @TechVest in #2486
- feat: start working on yaml support by @defnot001 in #2428
- chore: prepare knope by @ematipico in #2484
- ci: trigger prepare release by @ematipico in #2489
- ci: trigger prepare release by @ematipico in #2490
- chore: remove variables from workflows by @ematipico in #2491
- chore: speed up
wasm-pack
profiling build by @Sec-ant in #2494 - fix: reverts hashbrown, which causes issues when compiling to WASM by @ematipico in #2496
- fix(linter): name of typescript-eslint by @ematipico in #2503
- Handle operation parsing error GraphQL by @vohoanglong0107 in #2434
- chore: remove website from monorepo by @ematipico in #2505
- ci: add a workflow for linting pr titles by @unvalley in #2497
- feat(rule/solidjs): add no-react-specific-props by @marvin-j97 in #2427
- refactor(js_syntax): remove TsNameWithTypeArguments by @Conaclos in #2510
- fix(linter): add missing fix kind for solid rule by @ematipico in #2519
- feat(biome_css_analyzer): noCssEmptyBlock by @togami2864 in #2513
- chore: added how to create new css lint rule by @togami2864 in #2522
- refactor(css_formatter): implement FormatCssBlockLike by @denbezrukov in #2531
- feat(biome_css_analyze): noDuplicateSelectorsKeyframeBlock by @isnakode in #2534
- docs: fixed path to crates, updated link to translating doc by @viraxslot in #2538
- fix(biome_css_analyzer): update lint error messages by @togami2864 in #2545
- feat(biome_css_analyze): noImportantInKeyframe by @isnakode in #2542
- chore(deps): update rust crate serde_json to 1.0.116 by @renovate in #2553
- chore(deps): update rust crate proc-macro2 to 1.0.81 by @renovate in #2551
- chore(deps): update github-actions by @renovate in #2549
- chore: add a new bronze sponsor by @ematipico in #2556
- chore(deps): update rust:1.77.2 docker digest to 6052afe by @renovate in #2550
- chore(deps): update rust crate serde to 1.0.198 by @renovate in #2552
- feat(biome_graphql_parser): parse fragment definition by @vohoanglong0107 in #2506
- refactor(ci): add more valid PR title types by @Conaclos in #2559
- docs: fix typo in biome analyze contribution document by @GunseiKPaseri in #2560
- build(deps): remove 'case' dependency by @Conaclos in #2561
New Contributors
- @uncenter made their first contribution in #2477
- @t-shiratori made their first contribution in #2479
- @TechVest made their first contribution in #2486
- @defnot001 made their first contribution in #2428
- @marvin-j97 made their first contribution in #2427
- @viraxslot made their first contribution in #2538
- @GunseiKPaseri made their first contribution in #2560
Full Changelog: cli/v1.7.0...cli/v1.7.1
CLI v1.7.0
Analyzer
Bug fixes
-
Now Biome can detect the script language in Svelte and Vue script blocks more reliably (#2245). Contributed by @Sec-ant
-
useExhaustiveDependencies
no longer reports recursive calls as missing
dependencies (#2361).
Contributed by @arendjr -
useExhaustiveDependencies
correctly reports missing dependencies declared
using function declarations (#2362).
Contributed by @arendjr -
Biome now can handle
.svelte
and.vue
files withCRLF
as the end-of-line sequence. Contributed by @Sec-ant -
noMisplacedAssertion
no longer reports method calls bydescribe
,test
,it
objects (e.g.test.each([])()
) (#2443). Contributed by @unvalley. -
Biome now can handle
.vue
files with generic components (#2456).<script generic="T extends Record<string, any>" lang="ts" setup> //... </script>
Contributed by @Sec-ant
Enhancements
-
Complete the well-known file lists for JSON-like files. Trailing commas are allowed in
.jsonc
files by default. Some well-known files liketsconfig.json
and.babelrc
don't use the.jsonc
extension but still allow comments and trailing commas. While others, such as.eslintrc.json
, only allow comments. Biome is able to identify these files and adjusts thejson.parser.allowTrailingCommas
option accordingly to ensure they are correctly parsed. Contributed by @Sec-ant -
Fix dedent logic inconsistent with prettier where the indent-style is space and the indent-width is not 2. Contributed by @mdm317
CLI
New features
-
Add a command to migrate from ESLint
biome migrate eslint
allows you to migrate an ESLint configuration to Biome.
The command supports legacy ESLint configurations and new flat ESLint configurations.
Legacy ESLint configurations using the YAML format are not supported.When loading a legacy ESLint configuration, Biome resolves the
extends
field.
It resolves both shared configurations and plugin presets!
To do this, it invokes Node.js.Biome relies on the metadata of its rules to determine the equivalent rule of an ESLint rule.
A Biome rule is either inspired or roughly identical to an ESLint rules.
By default, inspired and nursery rules are excluded from the migration.
You can use the CLI flags--include-inspired
and--include-nursery
to migrate them as well.Note that this is a best-effort approach.
You are not guaranteed to get the same behavior as ESLint.Given the following ESLint configuration:
{ "ignore_patterns": ["**/*.test.js"], "globals": { "var2": "readonly" }, "rules": { "eqeqeq": "error" }, "overrides": [{ "files": ["lib/*.js"], "rules": { "default-param-last": "off" } }] }
biome migrate eslint --write
changes the Biome configuration as follows:{ "linter": { "rules": { "recommended": false, "suspicious": { "noDoubleEquals": "error" } } }, "javascript": { "globals": ["var2"] }, "overrides": [{ "include": ["lib/*.js"], "linter": { "rules": { "style": { "useDefaultParameterLast": "off" } } } }] }
Also, if the working directory contains
.eslintignore
, then Biome migrates the glob patterns.
Nested.eslintignore
in subdirectories and negated glob patterns are not supported.If you find any issue, please don't hesitate to report them.
Contributed by @Conaclos
-
Added two new options to customise the emitted output of the CLI:
--reporter=json
and--reporter=json-pretty
. With--reporter=json
, the diagnostics and the
summary will be printed in the terminal in JSON format. With--reporter=json-pretty
, you can print the same information, but formatted using the same options of your configuration.NOTE: the shape of the JSON is considered experimental, and the shape of the JSON might change in the future.
Example of output when running `biome format` command
```json { "summary": { "changed": 0, "unchanged": 1, "errors": 1, "warnings": 0, "skipped": 0, "suggestedFixesSkipped": 0, "diagnosticsNotPrinted": 0 }, "diagnostics": [ { "category": "format", "severity": "error", "description": "Formatter would have printed the following content:", "message": [ { "elements": [], "content": "Formatter would have printed the following content:" } ], "advices": { "advices": [ { "diff": { "dictionary": " statement();\n", "ops": [ { "diffOp": { "delete": { "range": [0, 2] } } }, { "diffOp": { "equal": { "range": [2, 12] } } }, { "diffOp": { "delete": { "range": [0, 2] } } }, { "diffOp": { "equal": { "range": [12, 13] } } }, { "diffOp": { "delete": { "range": [0, 2] } } }, { "diffOp": { "insert": { "range": [13, 15] } } } ] } } ] }, "verboseAdvices": { "advices": [] }, "location": { "path": { "file": "format.js" }, "span": null, "sourceCode": null }, "tags": [], "source": null } ], "command": "format" } ``` -
Added new
--staged
flag to thecheck
,format
andlint
subcommands.This new option allows users to apply the command only to the files that are staged (the
ones that will be committed), which can be very useful to simplify writing git hook scripts
such aspre-commit
. Contributed by @castarco
Enhancements
-
Improve support of
.prettierignore
when migrating from PrettierNow, Biome translates most of the glob patterns in
.prettierignore
to the equivalent Biome ignore pattern.
Only negated glob patterns are not supported.Contributed by @Conaclos
-
Support JavaScript configuration files when migrating from Prettier
biome migrate prettier
is now able to migrate Prettier configuration files
ending withjs
,mjs
, orcjs
extensions.
To do this, Biome invokes Node.js.Also, embedded Prettier configurations in
package.json
are now supported.Contributed by @Conaclos
-
Support
overrides
field in Prettier configuration files when migrating from Prettier.
Contributed by @Conaclos -
Support passing a file path to the
--config-path
flag or theBIOME_CONFIG_PATH
environment variable.Now you can pass a
.json
/.jsonc
file path with any filename to the--config-path
flag or the
BIOME_CONFIG_PATH
environment variable. This will disable the configuration auto-resolution and Biome
will try to read the configuration from the said file path (#2265).biome format --config-path=../biome.json ./src
Contributed by @Sec-ant
Bug fixes
-
Biome now tags the diagnostics emitted by
organizeImports
andformatter
with correct severity levels, so they will be properly filtered by the flag--diagnostic-level
(#2288). Contributed by @Sec-ant -
Biome now correctly filters out files that are not present in the current directory when using the
--changed
flag #1996. Contributed by @castarco -
Biome now skips traversing
fifo
orsocket
files (#2311). Contributed by @Sec-ant -
Biome now resolves configuration files exported from external libraries in
extends
from the working directory (CLI) or project root (LSP). This is the documented behavior and previous resolution behavior is considered as a bug (#2231). Contributed by @Sec-ant
Configuration
Bug fixes
-
Now setting group level
all
tofalse
can disable recommended rules from that group when top levelrecommended
istrue
or unset. Contributed by @Sec-ant -
Biome configuration files can correctly extends
.jsonc
configuration files now (#2279). Contributed by @Sec-ant -
Fixed the JSON schema for React hooks configuration (#2396). Contributed by @arendjr
Enhancements
-
Biome now displays the location of a parsing error for its configuration file (#1627).
Previously, when Biome encountered a parsing error in its configuration file,
it didn't indicate the location of the error.
It now displays the name of the configuration file and the range where the error occurred.Contributed by @Conaclos
-
options
is no longer required for rules without any options (#2313).Previously, the JSON schema required to set
options
tonull
when an object is used to set the diagnostic level of a rule without any option.
However, ifoptions
is set tonull
, Biome emits an error.The schema is now fixed and it no longer requires specifying
options
.
This makes the following configuration valid:{ "linter": { "rules": { "styl...
CLI v1.6.4
Analyzer
Bug fixes
- An operator with no spaces around in a binary expression no longer breaks the js analyzer (#2243). Contributed by @Sec-ant
CLI
Bug fixes
Configuration
Bug fixes
- Correctly calculate enabled rules in lint rule groups. Now a specific rule belonging to a group can be enabled even if its group-level preset option
recommended
orall
isfalse
(#2191). Contributed by @Sec-ant
Editors
Bug fixes
- Fix the unexpected code deletion and repetition when
quickfix.biome
is enabled and someimport
-related rules are applied (#2222, #688, #1015). Contributed by @Sec-ant
Linter
Bug fixes
-
Fix #2211. noChildrenProp should work fine when children pass as a prop in a new line. Contributed by @fireairforce
-
Fix #2248.
lint/a11y/useButtonType
should not trigger when button element with spread attribute. Contributed by @fireairforce -
Fix #2216.
lint/style/useNamingConvention
should not ignore JSX Component name binding. Contributed by @fireairforce
Enhancements
- Add support for object property members in the rule
useSortedClasses
. Contributed by @ematipico
Parser
-
The parser doesn't throw any error when the frontmatter of
.astro
files contains an illegal return:--- const condition = true; if (condition) { return "Something"; } --- <div></div>
Contributed by @ematipico
What's Changed
Other changes
- refactor(test): better infra for formatting by @ematipico in #2189
- chore(deps): update github-actions (major) by @renovate in #2190
- chore:
search
command infra by @arendjr in #2194 - Update labeler.yml by @arendjr in #2208
- feat(css_formatter): CssImportAtRule formatting by @denbezrukov in #2180
- chore: derive
Copy
onLoggingKind
andLoggingLevel
by @arendjr in #2207 - CSS parser parses sequence of custom idents for @font-feature-values #1743 by @denbezrukov in #2184
- chore(deps): update @biomejs packages by @renovate in #2196
- docs(pt-br): Update pt-br/index.mdx by @Exerea in #2139
- fix(docs): improve wording of docs for global Number rules by @LucianBuzzo in #2210
- feat(formatter): format
@starting-style
by @ematipico in #2213 - Implement graphql grammar by @vohoanglong0107 in #1949
- feat(lint): rule
noMisplacedAssertion
by @ematipico in #1935 - chore: add html parser crate by @ematipico in #2163
- Fixed a typo in the docs by @michaelnji in #2230
- chore(deps): update @biomejs packages by @renovate in #2229
- feat: css linter docs by @togami2864 in #2151
- feat(parser): basic parsing for HTML parser by @ematipico in #2238
- refactor(website): create a dedicated page for import sorting by @Conaclos in #2236
- chore: update governance document by @ematipico in #2235
- chore: fix typo in docs by @jgjgill in #2247
- chore(deps): update @biomejs packages by @renovate in #2256
- chore(deps): pin dependencies by @renovate in #2255
- chore(deps): pin dependencies by @renovate in #2252
- chore(deps): pin dependencies - autoclosed by @renovate in #2253
- chore: add myself as a maintainer by @ah-yu in #2270
- feat(parser): basic parsing element list with context bump by @ematipico in #2272
- ci: fix release regression by @ematipico in #2280
- chore: re-try release 1.6.4 by @ematipico in #2281
New Contributors
- @renovate made their first contribution in #2190
- @Exerea made their first contribution in #2139
- @LucianBuzzo made their first contribution in #2210
- @michaelnji made their first contribution in #2230
- @jgjgill made their first contribution in #2247
Full Changelog: cli/v1.6.3...cli/v1.6.4
CLI v1.6.3
Analyzer
CLI
Bug fixes
-
Fix configuration resolution. Biome is now able to correctly find the
biome.jsonc
configuration file when--config-path
is explicitly set (#2164). Contributed by @Sec-ant -
JavaScript/TypeScript files of different variants (
.ts
,.js
,.tsx
,.jsx
) in a single workspace now have stable formatting behaviors when running the CLI command in paths of different nested levels or in different operating systems (#2080, #2109). Contributed by @Sec-ant
Configuration
Bug fixes
- Complete the documentation and overrides support for options
formatter.lineEnding
,[language].formatter.lineEnding
,formatter.attributePosition
andjavascript.formatter.attributePosition
. Contributed by @Sec-ant
Editors
Formatter
Bug fixes
JavaScript APIs
Linter
New features
- Add rule noEvolvingAny to disallow variables from evolving into
any
type through reassignments. Contributed by @fujiyamaorange
LSP
Bug fixes
- Quickfix action no longer autofixes lint rule errors on save when
linter
is disabled (#2161). Contributed by @Sec-ant - Range formatting for Astro/Svelte/Vue doesn't place code out of place, especially when formatting on paste is enabled. Contributed by @ematipico
Parser
What's Changed
Other changes
- feat(parser): GritQL parser by @arendjr in #1998
- chore: reduce redundant lexer methods by @arendjr in #2165
- chore(ci): update
setup-rust
cache strategy by @Sec-ant in #2166 - chore(ci): do not cache nightly channel by @Sec-ant in #2167
- chore(ci): revert
wasm-pack
dev mode change by @Sec-ant in #2170 - fix(website): control flow by @Sec-ant in #2174
- feat(css_formatter): CssPropertyAtRule formatting by @denbezrukov in #2181
- feat(css_formatter): CssNamespaceAtRule formatting by @denbezrukov in #2182
- docs(guides/how-biome-works): remove dangling phrase by @marcalexiei in #2179
- fix(website): a small typo by @Sec-ant in #2192
- fix(codegen): new lint rule generation by @unvalley in #2187
- docs(website): translate integrate-biome-with-your-vcs into Japanese by @unvalley in #2176
New Contributors
- @marcalexiei made their first contribution in #2179
Full Changelog: cli/v1.6.2...cli/v1.6.3
CLI v1.6.2
Analyzer
Bug fixes
-
The
noSuperWithoutExtends
rule now allows for callingsuper()
in derived class constructors of class expressions (#2108). Contributed by @Sec-ant -
Fix discrepancies on file source detection. Allow module syntax in
.cts
files (#2114). Contributed by @Sec-ant
CLI
Bug fixes
-
Fixes #2131, where folders were incorrectly ignored when running the command
check
. Now folders are correctly ignored based on their command. Contributed by @ematipico -
Smoother handling of
"endOfLine": "auto"
in prettier migration: falling back to"lf"
(#2145). Contributed by @eMerzh
Configuration
Bug fixes
- Fix enabled rules calculation. The precendence of individual rules,
all
andrecommend
presets in top-level and group-level configs is now correctly respected. More details can be seen in (#2072) (#2028). Contributed by @Sec-ant
Formatter
Bug fixes
- Fix #1661. Now nested conditionals are aligned with Prettier's logic, and won't contain mixed spaces and tabs. Contributed by @ematipico
JavaScript APIs
Enhancements
- Support applying lint fixes when calling the
lintContent
method of theBiome
class (#1956). Contributed by @mnahkies
Linter
Bug fixes
-
Rule
noUndeclaredDependencies
now also validatespeerDependencies
andoptionalDependencies
(#2122). Contributed by @Sec-ant -
Rule
noUndeclaredDependencies
won't checkdeclare module
statements anymore (#2123). Contributed by @Sec-ant -
Fix #1925. The fix for
useOptionalChain
would sometimes suggest an incorrect fix that discarded optional chaining operators on the left-hand side of logical expressions. These are now preserved. Contributed by @arendjr -
Rule
noUndeclaredVariables
now also checks for worker globals (#2121). Contributed by @Sec-ant
LSP
Bug fixes
-
Correctly parse
.jsonc
files. Contributed by @Sec-ant -
Correctly resolve external
extends
configs. Contributed by @Sec-ant
Full Changelog: js-api/v0.5.0...cli/v1.6.2
CLI v1.6.1
CLI
Bug fixes
- CLI is now able to automatically search and resolve
biome.jsonc
(#2008). Contributed by @Sec-ant - Fix a false positive where some files were counted as "fixed" even though they weren't modified. Contributed by @ematipico
Configuration
Bug fixes
Linter
New features
-
Add rule noDoneCallback, this rule checks the function parameter of hooks & tests
for use of the done argument, suggesting you return a promise instead. Contributed by @vasucp1207beforeEach(done => { // ... });
Bug fixes
-
useJsxKeyInIterable now recognizes function bodies wrapped in parentheses (#2011). Contributed by @Sec-ant
-
useShorthandFunctionType now preserves type parameters of generic interfaces when applying fixes (#2015). Contributed by @Sec-ant
-
Code fixes of useImportType and useExportType now handle multiline statements (#2041). Contributed by @Conaclos
-
noRedeclare no longer reports type parameter and parameter with identical names (#1992).
The following code is no longer reported:
function f<a>(a: a) {}
Contributed by @Conaclos
-
noRedeclare now reports duplicate type parameters in a same declaration.
The following type parameters are now reported as a redeclaraion:
function f<T, T>() {}
Contributed by @Conaclos
-
noUndeclaredDependencies now recognizes imports of subpath exports.
E.g., the following import statements no longer report errors if
@mui/material
andtailwindcss
are installed as dependencies:import Button from "@mui/material/Button"; import { fontFamily } from "tailwindcss/defaultTheme";
Contributed by @Sec-ant
Parser
Bug fixes
-
JavaScript lexer is now able to lex regular expression literals with escaped non-ascii chars (#1941).
Contributed by @Sec-ant
What's Changed
Other changes
- fix: concurrency deadlock by @ematipico in #1980
- Add GritQL grammar by @arendjr in #1951
- fix: website favicon by @Sec-ant in #1989
- feat(cli): add
--stdio
argument tolsp-proxy
command by @nhedger in #1997 - release: update crates by @ematipico in #2002
- docs(website): remove nightly extension by @SuperchupuDev in #2018
- fix(
useShorthandFunctionType
): generic interface type parameters by @Sec-ant in #2020 - fix(playground): fix
bracketSameLine
default by @SuperchupuDev in #2021 - fix(supicious/noDoubleEquals): fix typo by @Kenzo-Wada in #2006
- chore: remove repetitive words by @pengqiseven in #2019
- chore: update js-api snapshot by @togami2864 in #2024
- docs: add description of exception for index usage by @chansuke in #2023
- feat(biome_js_analyze): update the methods of
noFocusedTests
by @chansuke in #1999 - chore: review contribution document by @ematipico in #2034
- docs: language creation by @ematipico in #2042
- Enable extra-traits feature in syn by @arendjr in #2049
- release: crates by @ematipico in #2050
- release: crates by @ematipico in #2055
- chore: remove unused deps by @Conaclos in #2053
- fix(website): result tab panel height by @Sec-ant in #2057
New Contributors
- @Kenzo-Wada made their first contribution in #2006
- @pengqiseven made their first contribution in #2019
Full Changelog: cli/v1.5.3-nightly.4fa841c...cli/v1.6.1
CLI v1.6.0
Analyzer
New features
-
Add partial for
.astro
files. Biome is able to sort imports inside the frontmatter of the Astro files. Contributed
by @ematipico--- - import { getLocale } from "astro:i18n"; - import { Code } from "astro:components"; + import { Code } from "astro:components"; + import { getLocale } from "astro:i18n"; --- <div></div>
-
Add partial for
.vue
files. Biome is able to sort imports inside the script block of Vue files. Contributed by
@nhedger<script setup lang="ts"> - import Button from "./components/Button.vue"; - import * as vueUse from "vue-use"; + import * as vueUse from "vue-use"; + import Button from "./components/Button.vue"; </script/> <template></template>
-
Add partial for
.svelte
files. Biome is able to sort imports inside the script block of Svelte files. Contributed by
@ematipico<script setup lang="ts"> - import Button from "./components/Button.svelte"; - import * as svelteUse from "svelte-use"; + import * as svelteUse from "svelte-use"; + import Button from "./components/Button.svelte"; </script/> <div></div>
-
Add lint rule useJsxKeyInIterable from Eslint rule
react/jsx-key
. Contributed by @vohoanglong0107 -
The analyzer now infers the correct quote from
javascript.formatter.quoteStyle
, if set. This means that code fixes suggested by the analyzer will use the same quote of the formatter. Contributed by @ematipico
Enhancements
-
noUnusedVariables ignores unused rest spread silbings.
The following code is now valid:
const { a, ...rest } = { a: 0, b: 1 }; console.log(rest);
Contributed by @ah-yu
-
Fix #1931. Built-in React hooks such as
useEffect()
can now be validated by the
useExhaustiveDependendies
, even
when they're not being imported from the React library. To do so, simply configure them like
any other user-provided hooks.Contributed by @arendjr
-
Implemented #1128. User-provided React hooks can
now be configured to track stable results. For example:"useExhaustiveDependencies": { "level": "error", "options": { "hooks": [{ "name": "useMyState", "stableResult": [ 1 ] }] } }
This will allow the following to be validated:
const [myState, setMyState] = useMyState(); const toggleMyState = useCallback(() => { setMyState(!myState); }, [myState]); // Only `myState` needs to be specified here.
Contributed by @arendjr
Bug fixes
-
Fix #1748. Now for the following case we won't provide an unsafe fix
for thenoNonNullAssertion
rule:x[y.z!];
Contributed by @ah-yu
-
Imports that contain the protocol
:
are now sorted after thenpm:
modules, and before theURL
modules.
Contributed by @ematipicoimport express from "npm:express"; - import Component from "./component.js" - import { sortBy } from "virtual:utils"; + import { sortBy } from "virtual:utils"; + import Component from "./component.js"
-
Fix #1081. The
useAwait
rule does not reportfor await...of
.
Contributed by @unvalley -
Fix #1827 by properly analyzing nested
try-finally
statements. Contributed by @ah-yu -
Fix #1924 Use the correct export name to sort in the import clause. Contributed by @ah-yu
-
Fix #1805 fix formatting arrow function which has conditional expression body Contributed by @mdm317
-
Fix #1781 by avoiding the retrieval of the entire static member expression for the reference if the static member expression does not start with the reference. 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. -
Now the file name printed in the diagnostics is clickable. If you run the CLI from your editor, you can
Ctrl/⌘ + Click on the file name, and the editor will open said file. If row and columns
are specified e.g.file.js:32:7
, the editor will set the cursor right in that position. Contributed by @ematipico -
Add an option
--linter
tobiome rage
. The option needs to check Biome linter configuration. Contributed by
@seitarof -
Add an option
--formatter
tobiome rage
. The option needs to check Biome formatter configuration. Contributed by
@seitarof -
The CLI now consistently reports the number of files tha were changed, out of the total files that were analysed. Contributed by @ematipico
-
The CLI now consistently shows the number of errors and warnings emitted. Contributed by @ematipico
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 completely skips the content of ignored directories.For now, directories cannot be ignored using
files.include
in the configuration file.
This is a known limitation that we want to address in a future release.For instance, if you have a project with a folder
src
and a foldertest
,
the following configuration doesn't completely ignoretest
.{ "files": { "include": ["src"] } }
Biome will traverse
test
,
however all files of the directory are correctly ignored.
This can result in file system errors,
if Biome encounters dangling symbolic links or files with higher permissions.To avoid traversing the
test
directory,
you should ignore the directory usingignore
:{ "files": { "include": ["src"], "ignore": ["test"] } }
-
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
-
Fix #1774 by taking into account the option
--no-errors-on-unmatched
when running the CLI using--changed
. Contributed by @antogyn
Enhancements
-
Removed a superfluous diagnostic that was printed during the linting/check phase of a file:
test.js check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × The file contains diagnostics that needs to be addressed.
Contributed by @ematipico
-
The command
format
now emits parsing diagnostics if there are any, and it will terminate with a non-zero exit code. Contributed by @ematipico
Configuration
New features
-
Add the ability to resolve the configuration files defined inside
extends
from thenode_modules/
directory.If you want to resolve a configuration file that matches the specifier
@org/configs/biome
, then yourpackage.json
file must look this:{ "name": "@org/configs", "exports": { "./biome": "./biome.json" } }
And the
biome.json
file that "imports" said configuration, will look like this:{ "extends": "@org/configs/biome" }
Read the documentation to better understand how it
works, expectations and restrictions.
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>
-
Add partial for
.vue
files. Biome is able to format the script block of Vue files. Contributed by @nhedger<script setup lang="ts"> - statement ( )...
CLI v1.5.3
LSP
Bug fixes
-
Fix #1584. Ensure the LSP only registers the formatter once. Contributed by @nhedger
-
Fix #1589. Fix invalid formatting of own line comments when they were at the end of an import/export list. Contributed by @SpanishPear
Configuration
Bug fixes
-
Override correctly the recommended preset (#1349).
Previously, if unspecified, Biome turned on the recommended preset in overrides.
This resulted in reporting diagnostics with a severity level set tooff
.
This in turn caused Biome to fail.Now Biome won't switch on the recommended preset in
overrides
unless told to do so.Contributed by @Conaclos
-
Don't format ignored files that are well-known JSONC files when
files.ignoreUnknown
is enabled (#1607).Previously, Biome always formatted files that are known to be JSONC files (e.g.
.eslintrc
) whenfiles.ignoreUnknown
was enabled.Contributed by @Conaclos
Formatter
Bug fixes
- Fix #1178, where the line ending option wasn't correctly applied. Contributed by @ematipico
- Fix #1571. Fix invalid formatting of nested multiline comments. Contributed by @ah-yu
Linter
Bug fixes
-
Fix #1575. noArrayIndexKey now captures array index value inside template literals and with string concatination. Contributed by @vasucp1207
-
Linter rules that inspect regexes now handle multibyte characters correctly (#1522).
Previously, noMisleadingCharacterClass, noMultipleSpacesInRegularExpressionLiterals, and noEmptyCharacterClassInRegex made Biome errors on multi-bytes characters.
Multibyte characters are now handled correctly.The following code no longer raises an internal error:
// Cyrillic characters /[\u200E\u2066-\u2069]/gu;
Contributed by @Conaclos
-
useExhaustiveDependencies no longer made Biome errors in code TypeScript import equal declarations (#1194). Contributed by @Conaclos
-
Fix typo in the diagnostic of noNodejsModules. Contributed by @huseeiin
Parser
Bug fixes
-
Accept the
const
modifier for type parameter in method type signature (#1624).The following code is now correctly parsed:
type Foo = { <const T>(); method<const T>(); };
Contributed by @magic-akari
Website
New
- Add a page that maps the Biome rule to its source. Contributed by @ematipico
Fixes
-
Generate Open Graph images based on the linked page. Contributed by @ematipico
-
Fix examples of the git hook page. Contributed by @9renpoto, @lmauromb, and @Conaclos
-
Fix dead and erroneous hyperlinks. Contributed by @Sec-ant and Conaclos
New Contributors
- @SpanishPear made their first contribution in #1604
- @9renpoto made their first contribution in #1612
- @huseeiin made their first contribution in #1621
- @Sec-ant made their first contribution in #1632
Full Changelog: cli/v1.5.2-nightly.91c7730...cli/v1.5.3
CLI v1.5.2
CLI
Bug fixes
-
Fix #1512 by skipping verbose diagnostics from the count. Contributed by @ematipico
-
Correctly handle cascading
include
andignore
.Previously Biome incorrectly included files that were included at tool level and ignored at global level.
In the following example,file.js
was formatted when it should have been ignored.
Now, Biome correctly ignores the directory./src/sub/
.❯ tree src src └── sub └── file.js ❯ cat biome.json { "files": { "ignore": ["./src/sub/"] }, "formatter": { "include": ["./src"] } }
Contributed by @Conaclos
-
Don't emit verbose warnings when a protected file is ignored.
Some files, such as
package.json
andtsconfig.json
, are protected.
Biome emits a verbose warning when it encounters a protected file.Previously, Biome emitted this verbose warning even if the file was ignored by the configuration.
Now, it doesn't emit verbose warnings for protected files that are ignored.Contributed by @Conaclos
-
overrides
no longer affect which files are ignored. Contributed by @Conaclos -
The file
biome.json
can't be ignored anymore. Contributed by @ematipico -
Fix #1541 where the content of protected files wasn't returned to
stdout
. Contributed by @ematipico -
Don't handle CSS files, the formatter isn't ready yet. Contributed by @ematipico
Configuration
Bug fixes
-
Fix 1440, a case where
extends
andoverrides
weren't correctly emitting the final configuration. Contributed by @arendjr -
Correctly handle
include
whenignore
is set (#1468). Contributed by @ConaclosPreviously, Biome ignored
include
ifignore
was set.
Now, Biome check bothinclude
andignore
.
A file is processed if it is included and not ignored.
Ifinclude
is not set all files are considered included.
Formatter
Bug fixes
-
Fix placement of comments before
*
token in generator methods with decorators. #1537 Contributed by @ah-yu -
Fix #1406. Ensure comments before the
async
keyword are placed before it. Contributed by @ah-yu -
Fix #1172. Fix placement of line comment after function expression parentheses, they are now attached to first statement in body. Contributed by @kalleep
-
Fix #1511 that made the JavaScript formatter crash. Contributed @Conaclos
Linter
Enhancements
-
Add an unsafe code fix for noConsoleLog. Contributed by @vasucp1207
-
useArrowFunction no longer reports function in
extends
clauses or in anew
expression. Contributed by @ConaclosThis cases requires the presence of a prototype.
Bug fixes
-
The fix of useArrowFunction now adds parentheses around the arrow function in more cases where it is needed (#1524).
A function expression doesn't need parentheses in most expressions where it can appear.
This is not the case with the arrow function.
We previously added parentheses when the function appears in a call or member expression.
We now add parentheses in binary-like expressions and other cases where they are needed, hopefully covering all cases.Previously:
- f = f ?? function() {}; + f = f ?? () => {};
Now:
- f = f ?? function() {}; + f = f ?? (() => {});
Contributed by @Conaclos
-
Fix #1514. Fix autofix suggestion to avoid the syntax error in
no_useless_fragments
. Contributed by @togami2864
What's Changed
Other changes
- docs(website): sync minor differences with the english version by @makotot in #1515
- docs(website): update
biomejs/setup-biome@v2
by @Marukome0743 in #1520 - refactor(cli): some cleanup by @ematipico in #1526
- docs(website): fix code snippets that take more space by @vasucp1207 in #1529
- chore: add myself as a maintainer by @vasucp1207 in #1532
- doc(website): upgrade doc for cn by @eryue0220 in #1525
- refactor(linter): add source metadata by @Conaclos in #1519
- docs(website): add git-hook Japanese translation by @OldBigBuddha in #1503
- Arendjr maintainer by @arendjr in #1540
- fix(docs): update $schema url by @malobre in #1539
- docs(pt-br): translated git hooks page by @CookieDasora in #1498
- feat: HTML grammar by @ematipico in #1544
- feat: foudations for migration from prettier by @ematipico in #1545
- chore: move
nhedger
to core contributors by @nhedger in #1557
New Contributors
- @makotot made their first contribution in #1515
- @ah-yu made their first contribution in #1500
- @OldBigBuddha made their first contribution in #1503
- @malobre made their first contribution in #1539
Full Changelog: cli/v1.5.1...cli/v1.5.2
CLI v1.5.1
CLI
Bug fixes
- The diagnostics
files/missingHandler
are now shown only when the option--verbose
is passed. Contributed by @ematipico - The diagnostics for protected files are now shown only when the option
--verbose
is passed. Contributed by @ematipico - Fix #1465, by taking in consideration the workspace folder when matching a pattern. Contributed by @ematipico
- Fix #1465, by correctly process globs that contain file names. Contributed by @ematipico
Formatter
Bug fixes
- Fix #1170. Fix placement of comments inside default switch clause. Now all line comments that have a preceding node will keep their position. Contributed by @kalleep
Linter
Bug fixes
-
Fix #1335. noUselessFragments now ignores code action on component props when the fragment is empty. Contributed by @vasucp1207
-
useConsistentArrayType was accidentally placed in the
style
rule group instead of thenursery
group. It is now correctly placed undernursery
. -
Fix #1483. useConsistentArrayType now correctly handles its option. Contributed by @Conaclos
-
Fix #1502. useArrowFunction now correctly handle functions that return a (comma) sequence expression. Contributed by @Conaclos
Previously the rule made an erroneous suggestion:
- f(function() { return 0, 1; }, ""); + f(() => 0, 1, "")
Now, the rule wraps any comma sequence between parentheses:
- f(function() { return 0, 1; }, ""); + f(() => (0, 1), "")
What's Changed
Other changes
- feat: update vscode extension image on website by @unvalley in #1470
- doc: add git-hook translation by @eryue0220 in #1444
- Fix typo in roadmap-2024.md by @yukukotani in #1474
- docs: update language server setup info for Helix by @David-Else in #1031
- fix: Use the correct diagnostic level in advice by @thewilloftheshadow in #1475
- docs(website): add
<link rel=alternate>
to RSS feeds by @azu in #1486
New Contributors
- @yukukotani made their first contribution in #1474
- @David-Else made their first contribution in #1031
- @thewilloftheshadow made their first contribution in #1475
- @azu made their first contribution in #1486
Full Changelog: cli/v1.5.0...cli/v1.5.1