Skip to content

Commit

Permalink
release: v1.2.0 (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos authored Sep 15, 2023
1 parent accf9b7 commit 1897c24
Show file tree
Hide file tree
Showing 299 changed files with 2,371 additions and 2,227 deletions.
61 changes: 44 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ Read our [guidelines to categorize a change](https://biomejs.dev/internals/versi
New entries must be placed in a section entitled `Unreleased`.
Read our [guidelines for writing a good changelog entry](https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md#changelog).

## Unreleased
## 1.2.0 (2023-09-15)

### Analyzer
### CLI

#### Features
#### New features

- Add new options to customize the behaviour the formatter based on the language of the file
- `--json-formatter-enabled`
Expand All @@ -25,14 +24,13 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom
- `--javascript-formatter-indent-size`
- `--javascript-formatter-line-width`


#### Bug fixes

- Fix a bug where `--errors-on-warning` didn't work when running `biome ci` command.

### Configuration

#### Features
#### New features

- Add new options to customize the behaviour of the formatter based on the language of the file
- `json.formatter.enabled`
Expand All @@ -44,14 +42,44 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom
- `javascript.formatter.indentSize`
- `javascript.formatter.lineWidth`

### Editors
### Formatter
### JavaScript APIs
### Linter
#### New features

#### Promoted rules

New rules are incubated in the nursery group.
Once stable, we promote them to a stable group.
The following rules are promoted:

- [a11y/noAriaUnsupportedElements](https://www.biomejs.dev/linter/rules/no-aria-unsupported-elements/)
- [a11y/noNoninteractiveTabindex](https://www.biomejs.dev/linter/rules/no-noninteractive-tabindex/)
- [a11y/noRedundantRoles](https://www.biomejs.dev/linter/rules/no-redundant-roles/)
- [a11y/useValidAriaValues](https://www.biomejs.dev/linter/rules/use-valid-aria-values/)
- [complexity/noBannedTypes](https://www.biomejs.dev/linter/rules/no-banned-types)
- [complexity/noStaticOnlyClass](https://www.biomejs.dev/linter/rules/no-static-only-class)
- [complexity/noUselessEmptyExport](https://www.biomejs.dev/linter/rules/no-useless-empty-export)
- [complexity/noUselessThisAlias](https://www.biomejs.dev/linter/rules/no-useless-this-alias)
- [correctness/noConstantCondition](https://www.biomejs.dev/linter/rules/no-constant-condition)
- [correctness/noNonoctalDecimalEscape](https://www.biomejs.dev/linter/rules/no-nonoctal-decimal-escape)
- [correctness/noSelfAssign](https://www.biomejs.dev/linter/rules/no-self-assign)
- [style/useLiteralEnumMembers](https://www.biomejs.dev/linter/rules/use-literal-enum-members)
- [style/useNamingConvention](https://www.biomejs.dev/linter/rules/use-naming-convention)
- [suspicious/noControlCharactersInRegex](https://www.biomejs.dev/linter/rules/no-control-characters-in-regex)
- [suspicious/noUnsafeDeclarationMerging](https://www.biomejs.dev/linter/rules/no-unsafe-declaration-merging)
- [suspicious/useGetterReturn](https://www.biomejs.dev/linter/rules/use-getter-return)

#### New rules

- Add [noConfusingVoidType](https://biomejs.dev/linter/rules/no-confusing-void-type/) rule. The rule reports the unusual use of the `void` type. Contributed by [@shulandmimi](https://github.com/shulandmimi)

#### Removed rules

- Remove [noConfusingArrow](https://biomejs.dev/linter/rules/no-confusing-arrow/).

Code formatters, such as prettier and Biome, always adds parentheses around the parameter or the body of an arrow function.
This makes the rule useless.

Contributed by [@Conaclos](https://github.com/Conaclos)

#### Enhancements

- [noFallthroughSwitchClause](https://biomejs.dev/linter/rules/no-fallthrough-switch-clause/) now relies on control flow analysis to report most of switch clause fallthrough. Contributed by [@Conaclos](https://github.com/Conaclos)
Expand Down Expand Up @@ -90,13 +118,6 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

Contributed by [@Conaclos](https://github.com/Conaclos)

- Remove [noConfusingArrow](https://biomejs.dev/linter/rules/no-confusing-arrow/).

Code formatters, such as prettier and Biome, always adds parentheses around the parameter or the body of an arrow function.
This makes the rule useless.

Contributed by [@Conaclos](https://github.com/Conaclos)

#### Bug fixes

- Fix [#182](https://github.com/biomejs/biome/issues/182), making [useLiteralKeys](https://biomejs.dev/linter/rules/use-literal-keys/) retains optional chaining. Contributed by [@denbezrukov](https://github.com/denbezrukov)
Expand Down Expand Up @@ -130,9 +151,15 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

Contributed by [@Conaclos](https://github.com/Conaclos)

### Parser
### VSCode

#### Enhancements

- Improve server binary resolution when using certain package managers, notably pnpm.

The new strategy is to point to `node_modules/.bin/biome` path,
which is consistent for all package managers.

## 1.1.2 (2023-09-07)

### Editors
Expand Down
11 changes: 1 addition & 10 deletions crates/biome_cli/tests/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2533,16 +2533,7 @@ fn should_not_enable_nursery_rules() {
fs.insert(configuration_path.into(), configuration.as_bytes());

let file_path = Path::new("fix.ts");
fs.insert(
file_path.into(),
r#"const bannedType: Boolean = true;
if (true) {
const obj = {};
obj["useLiteralKey"];
}
"#,
);
fs.insert(file_path.into(), r#"let confusingVoidType: void;"#);

let result = run_cli(
DynRef::Borrowed(&mut fs),
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_cli/tests/commands/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,7 @@ fn should_not_enable_nursery_rules() {
fs.insert(configuration_path.into(), configuration.as_bytes());

let file_path = Path::new("fix.ts");
fs.insert(file_path.into(), r#"const bannedType: Boolean = true;"#);
fs.insert(file_path.into(), r#"let confusingVoidType: void;"#);

let result = run_cli(
DynRef::Borrowed(&mut fs),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ check.js:1:1 lint/style/useWhile FIXABLE ━━━━━━━━━━━━
```

```block
check.js:1:6 lint/nursery/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
check.js:1:6 lint/correctness/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Unexpected constant condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ check.js:1:1 lint/style/useWhile FIXABLE ━━━━━━━━━━━━
```

```block
check.js:1:6 lint/nursery/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
check.js:1:6 lint/correctness/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Unexpected constant condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ expression: content
## `fix.ts`

```ts
const bannedType: Boolean = true;

if (true) {
const obj = {};
obj["useLiteralKey"];
}

let confusingVoidType: void;
```

# Termination Message
Expand All @@ -46,45 +40,15 @@ check ━━━━━━━━━━━━━━━━━━━━━━━━

# Emitted Messages

```block
fix.ts:5:6 lint/complexity/useLiteralKeys FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× The computed expression can be simplified without the use of a string literal.
3 │ if (true) {
4 │ const obj = {};
> 5 │ obj["useLiteralKey"];
│ ^^^^^^^^^^^^^^^
6 │ }
7 │
i Suggested fix: Use a literal key instead.
3 3 │ if (true) {
4 4 │ const obj = {};
5 │ - → obj["useLiteralKey"];
5 │ + → obj.useLiteralKey;
6 6 │ }
7 7 │
```

```block
fix.ts lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× The file contains diagnostics that needs to be addressed.
```

```block
fix.ts format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
i Formatter would have printed the following content:
7 │ → →
│ ----
1 │ - let·confusingVoidType:·void;
1 │ + let·confusingVoidType:·void;
2 │ +
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ci.js:1:1 lint/style/useWhile FIXABLE ━━━━━━━━━━━━━
```

```block
ci.js:1:6 lint/nursery/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ci.js:1:6 lint/correctness/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Unexpected constant condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ci.js:1:1 lint/style/useWhile FIXABLE ━━━━━━━━━━━━━
```

```block
ci.js:1:6 lint/nursery/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ci.js:1:6 lint/correctness/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Unexpected constant condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ check.js:1:1 lint/style/useWhile FIXABLE ━━━━━━━━━━━━
```

```block
check.js:1:6 lint/nursery/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
check.js:1:6 lint/correctness/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Unexpected constant condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ check.js:1:1 lint/style/useWhile FIXABLE ━━━━━━━━━━━━
```

```block
check.js:1:6 lint/nursery/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
check.js:1:6 lint/correctness/noConstantCondition ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Unexpected constant condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ expression: content
## `fix.ts`

```ts
const bannedType: Boolean = true;
let confusingVoidType: void;
```

# Emitted Messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ biome.json:6:13 deserialize ━━━━━━━━━━━━━━━━━
- all
- noChildrenProp
- noConstAssign
- noConstantCondition
- noConstructorReturn
- noEmptyPattern
- noGlobalObjectCalls
- noInnerDeclarations
- noInvalidConstructorSuper
- noNewSymbol
- noNonoctalDecimalEscape
- noPrecisionLoss
- noRenderReturnValue
- noSelfAssign
- noSetterReturn
- noStringCaseMismatch
- noSwitchDeclarations
Expand Down
Loading

0 comments on commit 1897c24

Please sign in to comment.