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

fix(migrate): suppress node warnings #3259

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

## Unreleased

### CLI

#### Bug fixes

- Fix [#3104](https://github.com/biomejs/biome/issues/3104) by suppressing node warnings when using `biome migrate`. Contributed by @SuperchupuDev

### Parser

#### New features
Expand All @@ -33,6 +39,7 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
- Fix [#3201](https://github.com/biomejs/biome/issues/3201) by correctly injecting the source code of the file when printing the diagnostics. Contributed by @ematipico
- Fix [#3179](https://github.com/biomejs/biome/issues/3179) where comma separators are not correctly removed after running `biome migrate` and thus choke the parser. Contributed by @Sec-ant
- Fix [#3232](https://github.com/biomejs/biome/issues/3232) by correctly using the colors set by the user. Contributed by @ematipico

#### Enhancement

- Reword the reporter message `No fixes needed` to `No fixes applied`.
Expand Down
3 changes: 3 additions & 0 deletions crates/biome_cli/src/execute/migrate/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{diagnostics::MigrationDiagnostic, CliDiagnostic};
/// returns the JSONified content of its default export.
pub(crate) fn load_config(specifier: &str) -> Result<Resolution, CliDiagnostic> {
let content_output = Command::new("node")
.env("NODE_NO_WARNINGS", "1")
.arg("--eval")
.arg(format!(
"{UNCYCLE_FUNCTION} import('{specifier}').then((c) => console.log(JSON.stringify(uncycle(c.default))))"
Expand All @@ -19,6 +20,7 @@ pub(crate) fn load_config(specifier: &str) -> Result<Resolution, CliDiagnostic>
},
Ok(output) => {
let path_output = Command::new("node")
.env("NODE_NO_WARNINGS", "1")
.arg("--print")
.arg(format!(
"require.resolve('{specifier}')"
Expand All @@ -28,6 +30,7 @@ pub(crate) fn load_config(specifier: &str) -> Result<Resolution, CliDiagnostic>
if !output.stderr.is_empty() {
// Try with `require` before giving up.
let output2 = Command::new("node")
.env("NODE_NO_WARNINGS", "1")
.arg("--eval")
.arg(format!(
"{UNCYCLE_FUNCTION} console.log(JSON.stringify(uncycle(require('{specifier}'))))"
Expand Down