Skip to content

Commit

Permalink
Merge branch 'main' into arendjr-maintainer
Browse files Browse the repository at this point in the history
  • Loading branch information
arendjr committed Jan 12, 2024
2 parents 09ab2cf + 925df81 commit e2ca16e
Show file tree
Hide file tree
Showing 429 changed files with 3,569 additions and 1,208 deletions.
76 changes: 57 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

- Fix [#1512](https://github.com/biomejs/biome/issues/1512) by skipping verbose diagnostics from the count. Contributed by @ematipico
- Don't handle CSS files, the formatter isn't ready yet. Contributed by @ematipico
- The file `biome.json` can't be ignored anymore. Contributed by @ematipico

### Configuration

### Editors

### Formatter

#### Bug fixes

- Fix placement of comments before `*` token in generator methods with decorators. [#1537](https://github.com/biomejs/biome/pull/1537) Contributed by @ah-yu

- Fix [#1406](https://github.com/biomejs/biome/issues/1406). Ensure comments before the `async` keyword are placed before it. Contributed by @ah-yu

- Fix [#1172](https://github.com/biomejs/biome/issues/1172). Fix placement of line comment after function expression parentheses, they are now attached to first statement in body. Contributed by @kalleep

### JavaScript APIs

### Linter
Expand All @@ -33,8 +42,35 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

- Add an unsafe code fix for [noConsoleLog](https://biomejs.dev/linter/rules/no-console-log/). Contributed by @vasucp1207

- [useArrowFunction](https://biomejs.dev/linter/rules/use-arrow-function) no longer reports function in `extends` clauses or in a `new` expression. COntributed by @Conaclos

This cases requires the presence of a prototype.

#### Bug fixes

- The fix of [useArrowFunction](https://biomejs.dev/linter/rules/use-arrow-function) now adds parentheses around the arrow function in more cases where it is needed ([#1524](https://github.com/biomejs/biome/issues/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:

```diff
- f = f ?? function() {};
+ f = f ?? () => {};
```

Now:

```diff
- f = f ?? function() {};
+ f = f ?? (() => {});
```

Contributed by @Conaclos

### Parser


Expand Down Expand Up @@ -62,11 +98,11 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

- Fix [#1335](https://github.com/biomejs/biome/issues/1335). [noUselessFragments](https://biomejs.dev/linter/rules/no-useless-fragments/) now ignores code action on component props when the fragment is empty. Contributed by @vasucp1207

- [useConsistentArrayType](https://biomejs.dev/rules/use-consistent-array-type) was accidentally placed in the `style` rule group instead of the `nursery` group. It is now correctly placed under `nursery`.
- [useConsistentArrayType](https://biomejs.dev/linter/rules/use-consistent-array-type) was accidentally placed in the `style` rule group instead of the `nursery` group. It is now correctly placed under `nursery`.

- Fix [#1483](https://github.com/biomejs/biome/issues/1483). [useConsistentArrayType](https://biomejs.dev/rules/use-consistent-array-type) now correctly handles its option. Contributed by @Conaclos
- Fix [#1483](https://github.com/biomejs/biome/issues/1483). [useConsistentArrayType](https://biomejs.dev/linter/rules/use-consistent-array-type) now correctly handles its option. Contributed by @Conaclos

- Fix [#1502](https://github.com/biomejs/biome/issues/1502). [useArrowFunction](https://biomejs.dev/rules/) now correctly handle functions that return a (comma) sequence expression. Contributed by @Conaclos
- Fix [#1502](https://github.com/biomejs/biome/issues/1502). [useArrowFunction](https://biomejs.dev/linter/rules/use-arrow-function) now correctly handle functions that return a (comma) sequence expression. Contributed by @Conaclos

Previously the rule made an erroneous suggestion:

Expand All @@ -82,6 +118,8 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom
+ f(() => (0, 1), "")
```

- Fix [#1473](https://github.com/biomejs/biome/issues/1473): [useHookAtTopLevel](https://biomejs.dev/linter/rules/use-hook-at-top-level/) now correctly handles React components and hooks that are nested inside other functions. Contributed by @arendjr


## 1.5.0 (2024-01-08)

Expand Down Expand Up @@ -484,7 +522,7 @@ The following rules are promoted:

- Fix [#696](https://github.com/biomejs/biome/issues/696). [useHookAtTopLevel](https://biomejs.dev/linter/rules/use-hook-at-top-level) now correctly detects early returns before the calls to the hook.

- The code fix of [noUselessTypeCOnstraint](https://biomejs.dev/linter/rules/no-useless-type-c-onstraint) now adds a trailing comma when needed to disambiguate a type parameter list from a JSX element. COntributed by @Conaclos
- The code fix of [noUselessTypeCOnstraint](https://biomejs.dev/linter/rules/no-useless-type-constraint) now adds a trailing comma when needed to disambiguate a type parameter list from a JSX element. COntributed by @Conaclos

- Fix [#578](https://github.com/biomejs/biome/issues/578). [useExhaustiveDependencies](https://biomejs.dev/linter/rules/use-exhaustive-dependencies) now correctly recognizes hooks namespaced under the `React` namespace. Contributed by @XiNiHa

Expand Down Expand Up @@ -675,7 +713,7 @@ The following rules are now recommended:
- [a11y/noAccessKey](https://biomejs.dev/linter/rules/no-access-key)
- [a11y/useHeadingContent](https://biomejs.dev/linter/rules/use-heading-content)
- [complexity/useSimpleNumberKeys](https://biomejs.dev/linter/use-simple-number-keys)
- [complexity/useSimpleNumberKeys](https://biomejs.dev/linter/rules/use-simple-number-keys)
The following rules are now deprecated:
Expand All @@ -694,7 +732,7 @@ The following rules are now deprecated:
- Add [useValidAriaRole](https://biomejs.dev/linter/rules/use-valid-aria-role). Contributed by @vasucp1207
- Add [useRegexLiterals](https://biomejs.dev/linter/use-regex-literals) that suggests turning call to the regex constructor into regex literals. COntributed by @Yuiki
- Add [useRegexLiterals](https://biomejs.dev/linter/rules/use-regex-literals) that suggests turning call to the regex constructor into regex literals. COntributed by @Yuiki
#### Enhancements
Expand Down Expand Up @@ -724,9 +762,9 @@ The following rules are now deprecated:
- Fix [#69](https://github.com/biomejs/biome/issues/69) that made [correctness/noUnnecessaryContinue](https://biomejs.dev/linter/rules/no-unnecessary-continue) incorrectly reports a `continue` used to break a switch clause. Contributed by @TaKO8Ki
- Fix [#664](https://github.com/biomejs/biome/issues/664) by improving the diagnostic of [style/useNamingConvention](https://biomejs.dev/linter/use-naming-convention) when double capital are detected in strict camel case mode. Contributed by @vasucp1207
- Fix [#664](https://github.com/biomejs/biome/issues/664) by improving the diagnostic of [style/useNamingConvention](https://biomejs.dev/linter/rules/use-naming-convention) when double capital are detected in strict camel case mode. Contributed by @vasucp1207
- Fix [#643](https://github.com/biomejs/biome/issues/643) that erroneously parsed the option of [complexity/useExhaustiveDependencies](https://biomejs.dev/linter/use-naming-convention). Contributed by @arendjr
- Fix [#643](https://github.com/biomejs/biome/issues/643) that erroneously parsed the option of [complexity/useExhaustiveDependencies](https://biomejs.dev/linter/rules/use-naming-convention). Contributed by @arendjr
### Parser
Expand Down Expand Up @@ -1025,7 +1063,7 @@ The following rules are now recommended:

- Add [noEmptyCharacterClassInRegex](https://biomejs.dev/linter/rules/no-empty-character-class-in-regex) rule. The rule reports empty character classes and empty negated character classes in regular expression literals. Contributed by @Conaclos

- Add [noMisleadingInstantiator](https://biomejs.dev/linter/rules/no-mileading-instantiator) rule. The rule reports the misleading use of the `new` and `constructor` methods. Contributed by @unvalley
- Add [noMisleadingInstantiator](https://biomejs.dev/linter/rules/no-misleading-instantiator) rule. The rule reports the misleading use of the `new` and `constructor` methods. Contributed by @unvalley

- Add [noUselessElse](https://biomejs.dev/linter/rules/no-useless-else) rule.
The rule reports `else` clauses that can be omitted because their `if` branches break.
Expand Down Expand Up @@ -1075,13 +1113,13 @@ The following rules are now recommended:
- [useEnumInitializers](https://biomejs.dev/linter/rules/use-enum-initializers)
- [useWhile](https://biomejs.dev/linter/rules/use-while)

- [noAccumulatingSpread](https://biomejs.dev/linter/no-accumulating-spread) makes more check in order to reduce potential false positives. Contributed by @Vivalldi
- [noAccumulatingSpread](https://biomejs.dev/linter/rules/no-accumulating-spread) makes more check in order to reduce potential false positives. Contributed by @Vivalldi

- [noConstAssign](https://biomejs.dev/linter/rules/no-const-assign) now provides an unsafe code fix that replaces `const` with `let`. Contributed by @vasucp1207

- [noExcessiveComplexity](https://biomejs.dev/linter/rules/no-excessive-complexity) default complexity threshold is now `15`. Contributed by @arendjr
- [noExcessiveComplexity](https://biomejs.dev/linter/rules/no-excessive-cognitive-complexity) default complexity threshold is now `15`. Contributed by @arendjr

- [noPositiveTabindexValue](https://biomejs.dev/linter/rules/no-positive-tabindex-value) now provides an unsafe code fix that set to `0` the tab index. Contributed by @vasucp1207
- [noPositiveTabindexValue](https://biomejs.dev/linter/rules/no-positive-tabindex) now provides an unsafe code fix that set to `0` the tab index. Contributed by @vasucp1207

- [noUnusedLabels](https://biomejs.dev/linter/rules/no-unused-labels) no longer reports unbreakable labeled statements. Contributed by @Conaclos

Expand Down Expand Up @@ -1213,7 +1251,7 @@ The following rules are promoted:

#### Removed rules

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

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.
Expand Down Expand Up @@ -1518,7 +1556,7 @@ The following rules are promoted:

- Fix [rome#4616](https://github.com/rome/tools/issues/4616)

Previously [noUnreachableSuper](https://biomejs.dev/linter/rules/no-unreacheable-super/) reported valid codes with complex nesting of control flow structures.
Previously [noUnreachableSuper](https://biomejs.dev/linter/rules/no-unreachable-super/) reported valid codes with complex nesting of control flow structures.

Contributed by @Conaclos

Expand Down Expand Up @@ -1711,11 +1749,11 @@ The following rules are promoted:

- Remove `useCamelCase`

Use [useNamingConvention](https://biomejs.dev/linter/rules/use-camel-case/) instead.
Use [useNamingConvention](https://biomejs.dev/linter/rules/use-naming-convention/) instead.

#### New rules

- Add [noExcessiveComplexity](https://biomejs.dev/linter/rules/no-excessive-complexity/)
- Add [noExcessiveComplexity](https://biomejs.dev/linter/rules/no-excessive-cognitive-complexity/)

- Add [useImportRestrictions](https://biomejs.dev/linter/rules/use-import-restrictions/)

Expand Down Expand Up @@ -1797,7 +1835,7 @@ The following rules are now recommended:
- [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare/): allow redeclare of index signatures are in different type members [#4478](https://github.com/rome/tools/issues/4478)
- Improve [noConsoleLog](https://biomejs.dev/linter/rules/no-console-log/), [noGlobalObjectCalls](https://biomejs.dev/linter/rules/no-global-object-calls/), [useIsNan](https://biomejs.dev/linter/rules/useisnan/), and [useNumericLiterals](https://biomejs.dev/linter/rules/use-numeric-literals/) by handling `globalThis` and `window` namespaces.
- Improve [noConsoleLog](https://biomejs.dev/linter/rules/no-console-log/), [noGlobalObjectCalls](https://biomejs.dev/linter/rules/no-global-object-calls/), [useIsNan](https://biomejs.dev/linter/rules/use-is-nan/), and [useNumericLiterals](https://biomejs.dev/linter/rules/use-numeric-literals/) by handling `globalThis` and `window` namespaces.
For instance, the following code is now reported by `noConsoleLog`:
Expand Down Expand Up @@ -2002,7 +2040,7 @@ The following rules are now recommended:
- Fix [noInvalidConstructorSuper](https://biomejs.dev/linter/rules/no-invalid-constructor-super/) that erroneously reported generic parents [#4624](https://github.com/rome/tools/issues/4624).
- Fix [noDuplicateCase](https://biomejs.dev/linter/rules/noDuplicateCase/) that erroneously reported as equals the strings literals `"'"` and `'"'` [#4706](https://github.com/rome/tools/issues/4706).
- Fix [noDuplicateCase](https://biomejs.dev/linter/rules/no-duplicate-case/) that erroneously reported as equals the strings literals `"'"` and `'"'` [#4706](https://github.com/rome/tools/issues/4706).
- Fix [NoUnreachableSuper](https://biomejs.dev/linter/rules/no-unreachable-super/)'s false positive diagnostics ([#4483](https://github.com/rome/tools/issues/4483)) caused to nested if statement.
Expand All @@ -2015,7 +2053,7 @@ The following rules are now recommended:
- Fix [noUselessConstructor](https://biomejs.dev/linter/rules/no-useless-constructor/) which erroneously reported constructors with default parameters [rome#4781](https://github.com/rome/tools/issues/4781)
- Fix [noUselessFragments](https://biomejs.dev/linter/rules/nouselessfragments/)'s panics when running `biome check --apply-unsafe` ([#4637](https://github.com/rome/tools/issues/4639))
- Fix [noUselessFragments](https://biomejs.dev/linter/rules/no-useless-fragments/)'s panics when running `biome check --apply-unsafe` ([#4637](https://github.com/rome/tools/issues/4639))
This rule's code action emits an invalid AST, so I fixed using JsxString instead of JsStringLiteral
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,5 @@ Members are listed in alphabetical order. Members are free to use the full name,
- [Madeline Gurriarán @SuperchupuDev](https://github.com/SuperchupuDev)
- [Nicolas Hedger @nhedger](https://github.com/nhedger)
- [Takayuki Maeda @TaKO8Ki](https://github.com/TaKO8Ki)
- [Vasu Singh @vasucp1207](https://github.com/vasucp1207)
- [Victor Teles @victor-teles](https://github.com/victor-teles)
2 changes: 1 addition & 1 deletion crates/biome_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub use crate::registry::{
};
pub use crate::rule::{
CategoryLanguage, FixKind, GroupCategory, GroupLanguage, Rule, RuleAction, RuleDiagnostic,
RuleGroup, RuleMeta, RuleMetadata, Source, SourceKind, SuppressAction,
RuleGroup, RuleMeta, RuleMetadata, RuleSource, RuleSourceKind, SuppressAction,
};
pub use crate::services::{FromServices, MissingServicesDiagnostic, ServiceBag};
pub use crate::signals::{
Expand Down
Loading

0 comments on commit e2ca16e

Please sign in to comment.