Skip to content
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

chore: next #4760

Draft
wants to merge 109 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
36b4b1c
feat: remove support for rome-ignore (#4252)
ematipico Oct 11, 2024
0425b90
feat: remove `--apply` and `--apply-unsafe` (#4268)
ematipico Oct 13, 2024
72ef826
fix: reduce accepted values for options (#4271)
ematipico Oct 14, 2024
1accca5
feat: remove `trailingComma` option (#4266)
ematipico Oct 14, 2024
1be9494
feat: remove `--indent-size` (#4270)
ematipico Oct 14, 2024
17ff3f6
feat: remove environment variable `BIOME_LOG_DIR` (#4289)
ematipico Oct 14, 2024
8e950b6
refactor: remove dead code (#4291)
Conaclos Oct 14, 2024
82ef3ce
feat: rename biome_rowan methods (#4297)
ematipico Oct 14, 2024
b0bf177
fix: use new methods
ematipico Oct 18, 2024
8b129ea
feat: plugin loader (#4234)
arendjr Oct 19, 2024
63eece0
update snapshots
ematipico Oct 21, 2024
9733e34
chore: update other snapshots
ematipico Oct 21, 2024
0680ba5
feat(analyzer): top level suppression (#4306)
ematipico Oct 21, 2024
d912491
chore: normalize Windows paths in plugin tests (#4362)
arendjr Oct 21, 2024
6a8ad85
feat(parser/js): remove assert syntax (#4360)
ematipico Oct 22, 2024
889cd5e
refactor(biome_deserialize): add deserilization context (#4166)
Conaclos Oct 22, 2024
57c64b4
chore: fix merge issues
ematipico Oct 23, 2024
74eaf89
feat: useExhaustiveDependencies not recommended (#4294)
ematipico Oct 23, 2024
da6d229
refactor(parser/js): rename import assertions to import attributes (#…
dyc3 Oct 25, 2024
d469189
feat(workspace): make types camel case (#4368)
ematipico Oct 25, 2024
b2ca29e
chore: update code and diagnostics (#4397)
ematipico Oct 27, 2024
bb66d05
refactor(biome_deserialize): add `indexmap` Cargo feature and remove …
Conaclos Oct 27, 2024
b5b6caa
feat(linter): analyzer plugin (#4396)
arendjr Oct 29, 2024
e955488
feat(grit): support `until` clause in `within` patterns (#4399)
arendjr Oct 29, 2024
3a28618
fix regressions
ematipico Oct 31, 2024
8c6e9b4
ci: fix errors and update snapshots (#4441)
Conaclos Oct 31, 2024
59f7e10
refactor: reduce dependency on indexmap (#4439)
Conaclos Nov 1, 2024
63201a9
feat(grit): support Grit queries targeting CSS (#4444)
arendjr Nov 1, 2024
7f0bb2a
feat(grit): implement CSS plugins (#4448)
arendjr Nov 2, 2024
3936022
feat(cli): change how behaves with large files (#4474)
ematipico Nov 6, 2024
00ddf2a
chore: fix merge conflicts
ematipico Nov 7, 2024
0d75b28
refactor: drop `DynRef` and move `fs` into `Workspace` (#4493)
arendjr Nov 11, 2024
39edbf2
refactor: move `useImportRestrictions` into `noRestrictedImports` (#4…
arendjr Nov 11, 2024
f281e8a
feat: better assist (#4508)
ematipico Nov 12, 2024
381aefd
refactor: use `biome-ignore-all` for top level suppressions (#4548)
ematipico Nov 18, 2024
0466823
chore: fix tests
ematipico Nov 18, 2024
ab5f0cd
refactor(analyzer): severity in metadata (#4634)
ematipico Nov 26, 2024
36ce68e
chore: fix incorrect rebase with `main`
ematipico Nov 27, 2024
b9d6bd1
rules check seems to not work anymore
ematipico Nov 27, 2024
aa9582f
fix test regression
ematipico Nov 27, 2024
7e13636
chore: add missing snapshot tests
ematipico Nov 28, 2024
f6009f0
fix options inside rules check
ematipico Nov 28, 2024
d8f91ba
chore: extract `noPackagePrivateImports` rule (#4651)
arendjr Nov 28, 2024
e5e83bb
fix warnings
ematipico Nov 28, 2024
4dd23c5
fix regressions around formatting
ematipico Nov 28, 2024
0bb9768
fix regression in parsing tests
ematipico Nov 28, 2024
f1973f8
docs: how to write a changeset (#4654)
ematipico Nov 29, 2024
c1b2e7b
feat(linter): rule `noTsIgnore` (#4650)
ematipico Nov 29, 2024
ad84856
refactor: use `papaya` instead of DashMap for workspace documents (#4…
arendjr Nov 29, 2024
7fc5346
feat(analyzer): range suppressions (#4649)
ematipico Dec 1, 2024
d2016ae
chore: use `papaya` in `PathInterner` (#4669)
arendjr Dec 1, 2024
55acffe
refactor: remove the `all` option (#4664)
ematipico Dec 3, 2024
3c1c017
refactor: get rule severity from metadata severity (#4687)
ematipico Dec 4, 2024
f5ba162
refactor: add `Workspace` scanner (#4682)
arendjr Dec 5, 2024
3914be8
chore: drop `slotmap` and simplify locking (#4696)
arendjr Dec 5, 2024
21ef4aa
feat(parser): better control on JSX parsing (#4718)
ematipico Dec 12, 2024
0a9d85a
feat(linter): domains and deps (#4713)
ematipico Dec 12, 2024
a478377
refactor: style recommendation and new recommended severity (#4730)
ematipico Dec 13, 2024
54ad2a3
fix(analyzer): don't use organize imports implicitly (#4724)
ematipico Dec 13, 2024
e77fb9d
refactor: protect scanned files against closing by LSP (#4735)
arendjr Dec 15, 2024
5c3e3e1
feat(lint): add `noUnwantedPolyfillio` (#4731)
unvalley Dec 17, 2024
8c73d11
Merge remote-tracking branch 'origin/main' into next
ematipico Dec 17, 2024
632e705
fix rebase
ematipico Dec 17, 2024
7d535da
refactor: track too large files inside workspace server (#4738)
arendjr Dec 17, 2024
21a6b2d
fix regression where some code was removed during merge
ematipico Dec 19, 2024
956b186
Merge remote-tracking branch 'origin/main' into next
ematipico Dec 19, 2024
ead17ca
more fixes!
ematipico Dec 19, 2024
d1ed7ae
update snapshot
ematipico Dec 19, 2024
a451b31
fix rule name
ematipico Dec 19, 2024
0590fe0
update snapshots
ematipico Dec 19, 2024
8d1062f
fix(json): treat `tsconfig.*.json` files as well known, allow comment…
dyc3 Dec 21, 2024
258f33f
perf: use `AppendOnlyVec` for `file_sources` (#4772)
arendjr Dec 21, 2024
9568041
feat: add migration for styling rules (#4759)
ematipico Dec 22, 2024
1907096
refactor: remove deprecated rules (#4766)
ematipico Dec 22, 2024
4f4cafb
feat: move `useWhile` to `complexity` (#4777)
ematipico Dec 23, 2024
93d1e23
refactor: remove `organizeImports` (#4788)
ematipico Dec 26, 2024
3704321
refactor: use camino for paths (#4797)
ematipico Dec 27, 2024
67df8b2
feat(html): plumbing for new HTML options, make `bracket_same_line` g…
dyc3 Dec 28, 2024
164dc85
refactor: cargo features (#4801)
ematipico Dec 29, 2024
f342128
feat(cli): better header in diagnostics (#4814)
ematipico Dec 30, 2024
f86999d
refactor(formatter): no trailing commas in JSON files (#4803)
ematipico Jan 1, 2025
562b249
Merge branch 'main' into next
ematipico Jan 2, 2025
3240f3d
chore: remove schema tests, to avoid future failings
ematipico Jan 2, 2025
d3b7b2d
refactor: resolve paths and globs from the configuration path (#4823)
ematipico Jan 2, 2025
17cf8f7
feat: add GritQL formatting options (#4824)
ematipico Jan 2, 2025
78c8910
feat(formatter): add `expand` (#4819)
ematipico Jan 3, 2025
2fee2a8
feat(html): set up HTML configuration (#4831)
dyc3 Jan 5, 2025
37296a2
refactor: drop "current" project from workspace and cleanup workspace…
arendjr Jan 6, 2025
24c8256
feat(format/html): implement whitespace sensitivity (#4818)
dyc3 Jan 6, 2025
262caf8
refactor(formatter): don't allocate strings, and use try operator ear…
ematipico Jan 7, 2025
01044aa
refactor: initial project layout (#4846)
arendjr Jan 7, 2025
2ae40a7
refactor: expose ProjectLayout as service (#4851)
arendjr Jan 8, 2025
dac3882
refactor: remove `ROME_BINARY` (#4853)
SuperchupuDev Jan 8, 2025
bb065c4
refactor(core): configuration, settings and capabilities (#4845)
ematipico Jan 8, 2025
f064fd4
fix(js_parser): parse huge binary expressions (#4856)
arendjr Jan 8, 2025
ec02891
fix(parser/html): misc minor parsing fixes (#4852)
dyc3 Jan 8, 2025
7da0e9a
fix(core): scan files in order (#4860)
arendjr Jan 9, 2025
074ac53
fix(core): print diagnostic for scanner panics (#4861)
arendjr Jan 9, 2025
12e3936
fix(css_parser): don't panic on unexpected EOF (#4862)
arendjr Jan 9, 2025
846e4a4
fix(lint): don't panic on incomplete code in noFallthroughSwitchClaus…
arendjr Jan 9, 2025
016046e
fix(lint): don't report missing dependency on incomplete statement (#…
arendjr Jan 9, 2025
1edc35f
feat(parser,format/html): add CDATA sections (#4859)
dyc3 Jan 9, 2025
9064d92
fix(parser/html): strictly detect tag starts, `<pre>` tag fixes (#4869)
dyc3 Jan 9, 2025
94bf15e
feat(linter): assign severity to groups (#4867)
ematipico Jan 10, 2025
7f0e969
fix(noUselessFragments): check Fragment when it under JSX Element or …
fireairforce Jan 13, 2025
46b41fa
fix(biome_diagnostics): fix JetBrains relative file URLs should be cl…
Andrew-Chen-Wang Jan 13, 2025
c9d0ba8
fix(js_parser): don't crash on malformed `for` statement (#4889)
arendjr Jan 13, 2025
d43aa7e
refactor(editorconfig): remove support for `max_line_length` (#4894)
ematipico Jan 13, 2025
4f07cc8
chore(core): better debug logging (#4891)
ematipico Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .changeset/add_new_option_javascriptjsxeverywhere.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
cli: minor
---

# Add new option `javascript.parser.jsxEverywhere`

This new option allows to control whether Biome should expect JSX syntax in `.js`/`.ts` files.

When `jsxEverywhere` is set to `false`, having JSX syntax like `<div></div>` inside `.js`/`.ts` files will result in a **parsing error**.

This option defaults to `true`.
5 changes: 5 additions & 0 deletions .changeset/add_the_new_rule_notsignorehttps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cli: minor
---

# Add the new rule [`noTsIgnore`](https://biomejs.dev/linter/rules/no-ts-ignore)
5 changes: 5 additions & 0 deletions .changeset/add_the_new_rule_nounwantedpolyfillio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cli: minor
---

# Add the new rule [`noUnwantedPolyfillio`](https://biomejs.dev/linter/rules/no-unwanted-polyfillio)
55 changes: 55 additions & 0 deletions .changeset/biome_assist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
cli: minor
---

# Biome assist

Biome assist is a new feature of the Biome analyzer. The assist is meant to provide **actions**. Actions differ from linter rules in that they aren't meant to signal errors.

The assist will provide code actions that users can opt into via configuration or via IDEs/editors, using the Language Server Protocol.

The assist **is enabled by default**. However, you can turn if off via configuration:

```json
{
"assist": {
"enabled": false
}
}
```

You can turn on the actions that you want to use in your configuration. For example, you can enable the `useSortedKeys` action like this:

```json
{
"assist": {
"actions": {
"source": {
"useSortedKeys": "on"
}
}
}
}
```

Alternatively, IDE/editor users can decide which action to apply on save *directly from the editor settings*, as long as the assist is enabled.

For example, in VS Code you can apply the `useSortedKeys` action when saving a file by adding the following snippet in `settings.json`:

```json
{
"editor.codeActionsOnSave": {
"source.biome.useSortedKeys": "explicit"
}
}
```

In Zed, you can achieve the same by adding the following snippet in `~/.config/zed/settings.json`:

```json
{
"code_actions_on_format": {
"source.biome.useSortedKeys": true
}
}
```
55 changes: 55 additions & 0 deletions .changeset/biome_deserialize_context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
biome_deserialize: minor
biome_deserialize_macros: minor
---

# Replace `diagnostics` with `context`

This is a **breaking change**.
You have to update all manual implementations of the `Deserializable` trait.

All deserialization methods take a `name` parameter.
This parameter is used to name the deserialized value.
For instance, in the case of deserialized value from an object field, the name is set to the field name.
However, this parameter has been abused to pass data such as file names between deserializers.

When we introduced macros to automatically implement `Deserializable`, users request a way of passing the name parameter between deserializers.
Then, we added the `passthrough_name` attribute to satisfy the request.
As said before, this was never intended for this usage.
There are some inherent limitations, notably some deserializers such as the deserializers of `Vec` set `name` to the empty string for all deserialized items.

We now introduce **deserialization context** to provide a proper way to pass a filename or any string identifier to all deserializers.
All deserializers now take a context parameter that stores this identifier.
We take the opportunity to integrate diagnostic reporting directly in this deserialization context.

Let's take the deserializer of `Day` presented in the `biome_deserialize` [README](https://github.com/biomejs/biome/tree/main/crates/biome_deserialize) as an example for migrating to the new paradigm.
You have to remove the `diagnostics` parameter and to add a new `ctx` parameter.
Note that the diagnostics are now reported using `ctx.report()`.

```diff
impl Deserializable for Day {
fn deserialize(
+ ctx: &mut impl DeserializationContext,
value: &impl DeserializableValue,
name: &str,
- diagnostics: &mut Vec<DeserializationDiagnostic>,
) -> Option<Self> {
// We deserialize the value into a number represented as a string.
let value_text = TextNumber::deserialize(ctx, value, name)?;
// We attempt to convert the string into a `Day`.
value_text.parse::<Day>().map_err(|error| {
// If the conversion failed, then we report the error.
- diagnostics.push(DeserializationDiagnostic::new(error).with_range(value.range()));
+ ctx.report(DeserializationDiagnostic::new(error).with_range(value.range()));
}).ok()
}
}
```

Biome provides `DefaultDeserializationContext` as a default implementation of `DeserializationContext`.
It is the implementation used by `biome_deserialize::deserialize_from_json_ast`, `biome_deserialize::deserialize_from_json_str`, or `biome_deserialize::::deserialize_from_str`.
The name (renamed `id`) passed as last parameter to `deserialize_from_json_ast` and `deserialize_from_json_str` now corresponds to the identifier that you can retrieve using `ctx.id()`.
This no longer sets the name of the deserialized root value.
The name of the deserialized root value is now the empty string.

Also, the `passthrough_name` macro attribute was removed because we now have a way of retrieving an identfiier from the context.
19 changes: 19 additions & 0 deletions .changeset/biome_deserialize_feature_gates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
biome_deserialize: minor
---

# Add the `indexmap` Cargo feature

This is a **breaking change**.

Previously, `biome_deserialize` required `serde` and `indexmap` as dependencies.
Its dependencies are now optional.

If you need the implementation of `Deserializable` for `indexmap::IndexMap` and `indexmap::IndexSet`, then you have to use the `indexmap` feature.
Update your `Cargo.toml` as follows:

```diff
[dependencies]
- biome_deserialize = { version: "<version>" }
+ biome_deserialize = { version: "<version>", features = ["indexmap"] }
```
12 changes: 12 additions & 0 deletions .changeset/biome_deserialize_remove_stringset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
biome_deserialize: minor
---

# Remove `biome_deserialize::StringSet`

This is a **breaking change**.

`biome_deserialize::StringSet` is now removed.
Use `indexmap::IndexSet<String>` instead.

As a consequence the cargo feature `schema` has been removed.
38 changes: 38 additions & 0 deletions .changeset/biome_migrate_eslint_rule_overriding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
biome_cli: minor
---

# Biome migrate eslint outputs a better overriding behavior

A Biome rule can have multiple ESLint equivalent rules.
For example, [useLiteralKeys](https://biomejs.dev/linter/rules/use-literal-keys/) has two ESLint equivalent rules: [dot-notation](https://eslint.org/docs/latest/rules/dot-notation) and [@typescript-eslint/dot-notation](https://typescript-eslint.io/rules/dot-notation/).

Previously, Biome wouldn't always enable a Biome rule even if one of its equivalent rules was enabled.
Now Biome uses the higher severity level of all the equivalent ESLint rules to set the severity level of the Biome rule.

The following ESLint configuration...

```json
{
"rules": {
"@typescript-eslint/dot-notation": "error",
"dot-notation": "off"
}
}
```

...is now migrated to...

```json
{
"linter": {
"rules": {
"complexity": {
"useLiteralKeys": "error"
}
}
}
}
```

...because `error` is higher than `off`.
37 changes: 37 additions & 0 deletions .changeset/code_actions_via_ideeditor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
cli: minor
---

# Code actions via IDE/editor

Biome users can now configure code actions from linter rules as well as assist actions directly in the settings of their IDE/editor.

For example, let's consider the lint rule [`noSwitchDeclarations`](https://biomejs.dev/linter/rules/no-switch-declarations/), which has an unsafe fix.
Previously, if you wanted to use this rule, you were "forced" to enable it via configuration, and if you wanted to apply its fix when you saved a file, you were forced to mark the fix as safe:

```json
{
"linter": {
"rules": {
"correctness": {
"noSwitchDeclarations": {
"level": "error",
"fix": "safe"
}
}
}
}
}
```

Now, you can benefit from the code action without making the fix safe for the entire project. IDEs and editors that are LSP compatible allow to list a series of "filters" or code actions that can be applied on save. In the case of VS Code, you will need to add the following snippet in the `settings.json`:

```json
{
"editor.codeActionsOnSave": {
"quickfix.biome.correctness.noSwitchDeclarations": "explicit"
}
}
```

Upon save, Biome will inform the editor the apply the code action of the rule `noSwitchDeclarations`.
35 changes: 35 additions & 0 deletions .changeset/enable_rule_with_default_severity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
cli: minor
---

# Enable rule with default severity

You can now enable lint rules using the default severity suggested by Biome using the new variant `"on"`, when enabling a rule.

For example, the default severity of the rule `style.noVar` is `error`, so you would use `"on"`, and then linting a code that uses `var`, will result in an error:

```json
{
"linter": {
"recommended": false,
"rules": {
"style": {
"noVar": "on"
}
}
}
}
```

```js
// main.js
var name = "tobias"
```

The command `biome lint main.js` will result in an error due to the default severity assigned to `noVar`.

Refer to the documentation page of each rule to know their suggested diagnostic severity, or use the command `biome explain <RULE_NAME>`:

```shell
biome explain noVar
```
56 changes: 56 additions & 0 deletions .changeset/introduce_the_domains_linter_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
cli: minor
---

# Introduce the `domains` linter feature

The Biome linter now has a new way to opt-in rules, with a concept called `domains`.

Domains can be seen as concepts shared by different rules.

You can enable and disable multiple rules that belong to a domain. When you assign `"all"`, Biome will enable all the rules, when you assign `"none"`, Biome will disable the rules, when you assign "recommended", Biome will enable all rules of the domain that are recommended.

```json5
// biome.jsonc
{
"linter": {
"domains": {
"test": "all", // all rules that belong to this domain are enabled
"react": "recommended", // only the recommended rules from this domain are enabled
"solid": "none" // rules related to Solid are disabled
}
}
}
```

New domains introduced:

- `test`: it will enable rules:
- `noExportsInTest`
- `noExcessiveNestedTestSuites`
- `noDuplicateTestHooks`
- `noFocusedTests`
And it will inject the following globals:
- `after`
- `afterAll`
- `afterEach`
- `before`
- `beforeEach`
- `beforeAll`
- `describe`
- `it`
- `expect`
- `test`
- `next`: it will enable rules for Next.js projects:
- `useExhaustiveDependencies`
- `useHookAtTopLevel`
- `noImgElement`
- `noHeadImportInDocument`
- `noHeadImportInDocument`
- `react`: it will enable rules for React projects:
- `useExhaustiveDependencies`
- `useHookAtTopLevel`
- `solid`: it will enable rules for Solid projects:
- `noReactSpecificProps`

For more information regarding how Biome enables rules via domains, please refer to the documentation page of each rule.
Loading
Loading