Skip to content

Commit

Permalink
Merge branch 'main' into fix/biomejs#3298
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-ebata committed Jul 23, 2024
2 parents 8aeebc5 + cbf3e77 commit 8c470f4
Show file tree
Hide file tree
Showing 323 changed files with 4,957 additions and 1,204 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:
run: |
bash scripts/print-changelog.sh ${{ needs.build.outputs.version }} >| ${{ github.workspace }}/RELEASE_NOTES
- name: Create GitHub release and tag
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_js_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
run: |
bash scripts/print-changelog.sh ${{ needs.build.outputs.version }} >| ${{ github.workspace }}/RELEASE_NOTES
- name: Create GitHub release and tag
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,37 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

### Formatter

#### Enhancements

- Add parentheses for nullcoalescing in ternaries.

This change aligns on [Prettier 3.3.3](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#333).
This adds clarity to operator precedence.

```diff
- foo ? bar ?? foo : baz;
+ foo ? (bar ?? foo) : baz;
```

Contributed by @Conaclos

#### Bug fixes

- Keep the parentheses around `infer` declarations in type unions and type intersections ([#3419](https://github.com/biomejs/biome/issues/3419)). Contributed by @Conaclos

- Keep parentheses around a `yield` expression inside a type assertion.

Previously, Biome removed parentheses around some expressions that require them inside a type assertion.
For example, in the following code, Biome now preserves the parentheses.

```ts
function* f() {
return <T>(yield 0);
}
```

Contributed by @Conaclos

### JavaScript APIs

### Linter
Expand Down Expand Up @@ -102,6 +129,14 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

Contributed by @Conaclos

- [useFilenamingConvention](https://biomejs.dev/linter/rules/use-filenaming-convention) now supports Next.js/Nuxt/Astro dynamic routes ([#3465](https://github.com/biomejs/biome/issues/3465)).

[Next.js](https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#catch-all-segments), [SolidStart](https://docs.solidjs.com/solid-start/building-your-application/routing#renaming-index), [Nuxt](https://nuxt.com/docs/guide/directory-structure/server#catch-all-route), and [Astro](https://docs.astro.build/en/guides/routing/#rest-parameters) support dynamic routes such as `[...slug].js` and `[[...slug]].js`.

Biome now recognizes this syntax. `slug` must contain only alphanumeric characters.

Contributed by @Conaclos

#### Bug fixes

- Don't request alt text for elements hidden from assistive technologies ([#3316](https://github.com/biomejs/biome/issues/3316)). Contributed by @robintown
Expand Down
57 changes: 31 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,36 @@ We can use help in a bunch of areas and any help is greatly appreciated!

## Table of Contents

* [Asking questions, making proposals](#asking-questions-making-proposals)
* [Reporting bugs](#reporting-bugs)
* [Getting Started](#getting-started)
* [Install the required tools](#install-the-required-tools)
* [Testing](#testing)
+ [Debugging](#debugging)
* [Checks](#checks)
* [Crates development](#crates-development)
+ [Analyzers and lint rules](#analyzers-and-lint-rules)
+ [Parser](#parser)
+ [Formatter](#formatter)
* [Crate dependencies](#crate-dependencies)
* [Node.js development](#nodejs-development)
+ [Translations](#translations)
* [Commit messages](#commit-messages)
* [Creating pull requests](#creating-pull-requests)
+ [Changelog](#changelog)
- [Writing a changelog line](#writing-a-changelog-line)
+ [Documentation](#documentation)
+ [Versioning](#versioning)
* [Releasing](#releasing)
* [Resources](#resources)
* [Current Members](#current-members)
+ [Lead team](#lead-team)
+ [Core Contributors team](#core-contributors-team)
+ [Maintainers team](#maintainers-team)
- [🚀 Contributing](#-contributing)
- [Table of Contents](#table-of-contents)
- [Asking questions, making proposals](#asking-questions-making-proposals)
- [Reporting bugs](#reporting-bugs)
- [Getting Started](#getting-started)
- [Install the required tools](#install-the-required-tools)
- [Testing](#testing)
- [Debugging](#debugging)
- [Checks](#checks)
- [Crates development](#crates-development)
- [Create new crates](#create-new-crates)
- [Analyzers and lint rules](#analyzers-and-lint-rules)
- [Parser](#parser)
- [Formatter](#formatter)
- [Crate dependencies](#crate-dependencies)
- [Node.js development](#nodejs-development)
- [Translations](#translations)
- [Commit messages](#commit-messages)
- [Creating pull requests](#creating-pull-requests)
- [Changelog](#changelog)
- [Writing a changelog line](#writing-a-changelog-line)
- [Documentation](#documentation)
- [Versioning](#versioning)
- [Releasing](#releasing)
- [Resources](#resources)
- [Current Members](#current-members)
- [Lead team](#lead-team)
- [Core Contributors team](#core-contributors-team)
- [Maintainers team](#maintainers-team)
- [Past Maintainers](#past-maintainers)

## Asking questions, making proposals

Expand Down Expand Up @@ -425,6 +429,7 @@ Members are listed in alphabetical order. Members are free to use the full name,

### Maintainers team

- [Carson McManus @dyc3](https://github.com/dyc3)
- [Dani Guardiola @DaniGuardiola](https://github.com/DaniGuardiola)
- [Justinas Delinda @minht11](https://github.com/minht11)
- [Madeline Gurriarán @SuperchupuDev](https://github.com/SuperchupuDev)
Expand Down
41 changes: 26 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ biome_graphql_analyze = { version = "0.0.1", path = "./crates/biome_graph
biome_graphql_factory = { version = "0.1.0", path = "./crates/biome_graphql_factory" }
biome_graphql_formatter = { version = "0.1.0", path = "./crates/biome_graphql_formatter" }
biome_graphql_parser = { version = "0.1.0", path = "./crates/biome_graphql_parser" }
biome_graphql_semantic = { version = "0.0.0", path = "./crates/biome_graphql_semantic" }
biome_graphql_syntax = { version = "0.1.0", path = "./crates/biome_graphql_syntax" }
biome_grit_factory = { version = "0.5.7", path = "./crates/biome_grit_factory" }
biome_grit_formatter = { version = "0.0.0", path = "./crates/biome_grit_formatter" }
Expand Down Expand Up @@ -156,7 +157,7 @@ tests_macros = { path = "./crates/tests_macros" }

# Crates needed in the workspace
anyhow = "1.0.86"
bitflags = "2.5.0"
bitflags = "2.6.0"
bpaf = { version = "0.9.9", features = ["derive"] }
countme = "3.0.1"
crossbeam = "0.8.4"
Expand All @@ -166,7 +167,7 @@ getrandom = "0.2.15"
ignore = "0.4.21"
indexmap = { version = "2.2.6", features = ["serde"] }
insta = "1.39.0"
lazy_static = "1.4.0"
lazy_static = "1.5.0"
natord = "1.0.9"
oxc_resolver = "1.8.1"
proc-macro2 = "1.0.86"
Expand All @@ -185,7 +186,7 @@ slotmap = "1.0.7"
smallvec = { version = "1.13.2", features = ["union", "const_new", "serde"] }
syn = "1.0.109"
termcolor = "1.4.1"
tokio = "1.38.0"
tokio = "1.38.1"
tracing = { version = "0.1.40", default-features = false, features = ["std"] }
tracing-subscriber = "0.3.18"
unicode-bom = "2.0.3"
Expand Down
14 changes: 7 additions & 7 deletions crates/biome_cli/src/execute/process_file/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ pub(crate) fn lint_with_guard<'ctx>(
move || {
let mut input = workspace_file.input()?;
let mut changed = false;
let (only, skip) =
if let TraversalMode::Lint { only, skip, .. } = ctx.execution.traversal_mode() {
(only.clone(), skip.clone())
} else {
(Vec::new(), Vec::new())
};
if let Some(fix_mode) = ctx.execution.as_fix_file_mode() {
let fix_result = workspace_file
.guard()
.fix_file(*fix_mode, false)
.fix_file(*fix_mode, false, only.clone(), skip.clone())
.with_file_path_and_code(
workspace_file.path.display().to_string(),
category!("lint"),
Expand Down Expand Up @@ -57,12 +63,6 @@ pub(crate) fn lint_with_guard<'ctx>(
}

let max_diagnostics = ctx.remaining_diagnostics.load(Ordering::Relaxed);
let (only, skip) =
if let TraversalMode::Lint { only, skip, .. } = ctx.execution.traversal_mode() {
(only.clone(), skip.clone())
} else {
(Vec::new(), Vec::new())
};
let pull_diagnostics_result = workspace_file
.guard()
.pull_diagnostics(
Expand Down
13 changes: 8 additions & 5 deletions crates/biome_cli/src/execute/std_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,20 @@ pub(crate) fn run<'a>(
return Ok(());
};

let (only, skip) = if let TraversalMode::Lint { only, skip, .. } = mode.traversal_mode() {
(only.clone(), skip.clone())
} else {
(Vec::new(), Vec::new())
};

if let Some(fix_file_mode) = mode.as_fix_file_mode() {
if file_features.supports_lint() {
let fix_file_result = workspace.fix_file(FixFileParams {
fix_file_mode: *fix_file_mode,
path: biome_path.clone(),
should_format: mode.is_check() && file_features.supports_format(),
only: only.clone(),
skip: skip.clone(),
})?;
let code = fix_file_result.code;
let output = match biome_path.extension_as_str() {
Expand Down Expand Up @@ -156,11 +164,6 @@ pub(crate) fn run<'a>(
}
}

let (only, skip) = if let TraversalMode::Lint { only, skip, .. } = mode.traversal_mode() {
(only.clone(), skip.clone())
} else {
(Vec::new(), Vec::new())
};
if !mode.is_check_apply_unsafe() {
let result = workspace.pull_diagnostics(PullDiagnosticsParams {
categories: RuleCategoriesBuilder::default()
Expand Down
Loading

0 comments on commit 8c470f4

Please sign in to comment.