-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: 1.6.0 #1969
Merged
Merged
release: 1.6.0 #1969
Changes from 3 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
195dd5e
release: 1.6.0
ematipico 92391f7
update some documentation
ematipico 1489b21
chore: first draft of the blog post
ematipico d442905
one more chapter
ematipico a52a484
Apply suggestions from code review
ematipico aefd29d
feat: promote rule (#1978)
Conaclos 3cb83bf
Merge branch 'main' into relase/1.6.0
Conaclos 4a3c7f6
trailingCommas with S, and codegen
ematipico 5d1a2c8
fix: avoid source overriding of useConsistentArrayType
Conaclos 2573386
apply changes and fix changed check
ematipico a49f6ba
fix incorrect order in changelog example
ematipico e6c7606
refactor(lint/noUnusedVariables): don't report unused imports
Conaclos 486dad2
Merge remote-tracking branch 'refs/remotes/origin/relase/1.6.0' into …
Conaclos 0f291d8
refactor: remove useGroupedTypeImports
Conaclos b4dec0e
chore: update crates
ematipico 49035c0
chore: fix changelog
ematipico 57af3b8
Merge remote-tracking branch 'origin/main' into relase/1.6.0
ematipico 61144f3
better explanation
ematipico c942068
fix diagnostics for `useJsxKeyInIterable`
ematipico a69cdf2
refacor: remove future dead links
Conaclos 9cd09a0
refactor(lint): set version of new rules
Conaclos 3893b1d
Update website/src/content/blog/biome-v1-6.mdx
ematipico 7572772
apply suggestion
ematipico 054c0fa
add warning
ematipico b5b7077
refactor: move useAwait in suspicious and set as not recommended
Conaclos dc31ee7
Merge branch 'relase/1.6.0' of github.com:biomejs/biome into relase/1…
Conaclos b081455
Update CHANGELOG.md
Conaclos 6832bad
Update website/src/content/blog/biome-v1-6.mdx
Conaclos 4206878
Update website/src/content/docs/internals/language-support.mdx
Conaclos 5f8b156
Update website/src/content/docs/internals/language-support.mdx
Conaclos 7024c4a
Update website/src/content/docs/guides/getting-started.mdx
Conaclos 3b4f49d
Update website/src/content/docs/guides/getting-started.mdx
Conaclos daf339b
Update website/src/content/blog/biome-v1-6.mdx
Conaclos 2d0b90e
chore: update changelog
Conaclos ac991ec
Merge branch 'main' into relase/1.6.0
Conaclos 6fdfdf5
fix: remove warning
Conaclos 1738773
fix: update 1.6.0 config schema
Conaclos 95f1a82
chore(blog): add new rules section
Conaclos 962087a
chore: update number of rules
ematipico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,228 @@ | ||
--- | ||
title: Biome v1.6 | ||
description: Partial support for Astro, Svelte and Vue, extend configuration from dependencies, formatter goodies. | ||
summary: | | ||
Partial support for Astro, Svelte and Vue files, both CLI and LSP. | ||
Now, the `extends` field is able to pick configuration files that are exported as a dependency, very useful in monorepo and big projects. | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
The formatter has new options. | ||
authors: | ||
- ema | ||
- team | ||
pubDate: 2024-03-08 | ||
coverImage: | ||
lightSrc: "@/assets/blog/roadmap-2024/banner-light.png" | ||
darkSrc: "@/assets/blog/roadmap-2024/banner-dark.png" | ||
alt: The brand of the project. It says "Biome, toolchain of the web" | ||
socialImage: "@/assets/social-logo.png" | ||
--- | ||
|
||
import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
import { Image } from "astro:assets"; | ||
import astroLint from "../../assets/blog/biome-v1-6/astro-linter.png" | ||
import vueLint from "../../assets/blog/biome-v1-6/vue-linter.png" | ||
import svelteLint from "../../assets/blog/biome-v1-6/svelte-linter.png" | ||
|
||
Update Biome using the following commands: | ||
|
||
```shell | ||
npm install --save-dev --save-exact @biomejs/biome@latest | ||
npx @biomejs/biome migrate | ||
``` | ||
|
||
## Partial support for Astro, Svelte and Vue files | ||
|
||
In this release, we're happy to provide partial support for Astor, Svelte and Vue files. What does **partial** support mean? | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
While the team is working on a [unified data structure](https://github.com/biomejs/biome/discussions/1726) for HTML-ish languages, we discovered that we could provide Biome functionalities to those files with just few changes, albeit some expectations. | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This means that Biome is able to analyse the JavaScript/TypeScript portion of said files, and all features are available: formatting, linting and import sorting! Here's an example that you should expect in terms of developer experience: | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<Tabs> | ||
<TabItem label="Astro" icon="astro"> | ||
<div align="center"> | ||
<Image src={astroLint} alt="Screenshot of Biome linting in action for an Astro file in VSCode" width="500" /> | ||
</div> | ||
</TabItem> | ||
<TabItem label="Vue" icon="seti:vue"> | ||
<div align="center"> | ||
<Image src={vueLint} alt="Screenshot of Biome linting in action for an Vue file in VSCode" width="500" /> | ||
</div> | ||
</TabItem> | ||
<TabItem label="Svelte" icon="seti:svelte"> | ||
<div align="center"> | ||
<Image src={svelteLint} alt="Screenshot of Biome linting in action for an Svelte file in VSCode" width="500" /> | ||
</div> | ||
</TabItem> | ||
</Tabs> | ||
|
||
Make sure to read the [documentation about expectations and limitations](/internals/language-support#html-super-languages-support). | ||
|
||
## Configuration, lighter and more powerful | ||
|
||
### Support for `biome.jsonc` | ||
|
||
Biome now accepts the file `biome.jsonc` as configuration! Now, you can insert all the comments you want in a configuration. | ||
Conaclos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### `extends` resolves dependencies | ||
|
||
From this version, Biome can the `extends` property can *resolve* other configuration files that are installed and exported as a dependency. | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
There are few important steps in order to make the configuration discoverable. The file must be exported from a `"module"` package, and the file should be exported in your `package.json` like this: | ||
|
||
```json name="shared-configs/package.json" | ||
{ | ||
"name": "@shared-configs", | ||
"type": "module", | ||
"exports": { | ||
"./biome": "./biome.json" | ||
} | ||
} | ||
``` | ||
|
||
This set up allows to expose a specifier `@shared-configs/biome`, which you use inside your `biome.json` file. | ||
|
||
```json name="project/biome.json" | ||
{ | ||
"extends": ["@shared-configs/biome"] | ||
} | ||
``` | ||
|
||
The resolution of the dependencies is powered by the library [`oxc-resolver`](https://github.com/oxc-project/oxc-resolver), one of the many libraries provided by the [OXC project](https://oxc-project.github.io/). It's battle-tested and spec compliant! | ||
|
||
:::note | ||
You can also export `biome.jsonc` files! | ||
|
||
```json name="shared-configs/package.json" ins="./biome.jsonc" | ||
{ | ||
"name": "@shared-configs", | ||
"type": "module", | ||
"exports": { | ||
"./biome": "./biome.jsonc" | ||
} | ||
} | ||
``` | ||
::: | ||
|
||
### Reduced memory footprint | ||
|
||
We **reduced** the size our configuration **by a factor of 6.5**! This change might not have massive effects on the speed of the program, but it greatly reduced the memory used when running the CLI or the LSP. | ||
|
||
## New formatting options | ||
|
||
Other than fixes, the formatter provides two new options that should improve the compatibility with Prettier parity | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Option `attributePosition` | ||
|
||
The contributor [@octoshikari](https://github.com/octoshikari) implemented this new feature by themselves! Huge thank you for helping the Biome project. | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
When `formatter.attributePosition` has the value `multiline`, all attributes of HTML-ish languages (JSX/TSX as for time of writing) will be collapsed on multiple lines regardless of their numbers: | ||
|
||
|
||
<div class="card"> | ||
<div class="card-column"> | ||
<h4>With variant `auto` (default)</h4> | ||
The attributes are automatically formatted, and they will collapse in multiple lines only when they hit certain criteria. | ||
|
||
```jsx title="file.jsx" | ||
<Button as="link" style="primary" href="https://example.com"> | ||
Hit me | ||
</Button> | ||
``` | ||
</div> | ||
<div class="card-column"> | ||
<h4>With variant `multiline`</h4> | ||
The attributes are always formatted on multiple lines, regardless. | ||
|
||
```jsx title="file.jsx" | ||
<Button | ||
as="link" | ||
style="primary" | ||
href="https://example.com" | ||
> | ||
Hit me | ||
</Button> | ||
``` | ||
</div> | ||
</div> | ||
|
||
|
||
### Option `json.formatter.trailingComma` | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Previously, Biome parser introduced an option that would allow to parse JSON and JSONC files that contained a trailing comma. This was required to ease the friction caused by other tools that | ||
tolerate trailing commas by default (e.g. VSCode, Prettier, etc.). | ||
|
||
Although, our formatter wasn't as tolerant. With the option `json.formatter.trailingComma`, you can apply the same rules that `js.formatter.trailingComma` applies. | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<div class="card"> | ||
<div class="card-column"> | ||
<h4>With variant `none` (default)</h4> | ||
The formatter removes the trailing comma upon formatting. | ||
|
||
```json title="file.json" ins="\"ipsum_last\"" | ||
{ | ||
"lorem": "ipsum", | ||
"lorem": "ipsum", | ||
"lorem": "ipsum", | ||
"lorem": "ipsum_last" | ||
} | ||
``` | ||
</div> | ||
<div class="card-column"> | ||
<h4>With variant `all`</h4> | ||
The formatter adds the trailing comma upon formatting. | ||
|
||
```json title="file.json" ins="\"ipsum_last\"," | ||
{ | ||
"lorem": "ipsum", | ||
"lorem": "ipsum", | ||
"lorem": "ipsum", | ||
"lorem": "ipsum_last", | ||
} | ||
``` | ||
</div> | ||
</div> | ||
|
||
## Easier migration from Prettier | ||
|
||
This release introduces a new command called `biome migrate prettier`. This command will read your Prettier `.prettierrc`/`prettier.json` and `.prettierignore`, and attempt to port its options and globs in Biome. | ||
|
||
Given a `prettier.json` file, Biome will **modify** the existing configuration file to match Prettier's options: | ||
|
||
```json title="prettier.json" | ||
{ "useTabs": false, "semi": true, "singleQuote": true } | ||
``` | ||
|
||
```json title="biome.json" | ||
{ | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineEnding": "lf", | ||
"lineWidth": 80, | ||
"attributePosition": "auto" | ||
}, | ||
"linter": { "enabled": true }, | ||
"javascript": { | ||
"formatter": { | ||
"jsxQuoteStyle": "double", | ||
"quoteProperties": "asNeeded", | ||
"trailingComma": "all", | ||
"semicolons": "always", | ||
"arrowParentheses": "always", | ||
"bracketSpacing": true, | ||
"bracketSameLine": false, | ||
"quoteStyle": "single", | ||
"attributePosition": "auto" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
:::caution | ||
Due to the different nature of `.prettierignore` globs and Biome’s globs, it’s **highly advised** to make sure that those globs still work under Biome. | ||
Prettier's globs are **git globs**, while Biome's globs are **unix-style** globs. | ||
::: | ||
|
||
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes an issue in the LSP when showing diagnostics. Spans were incorrect