Skip to content

Commit

Permalink
fix(migrate): suppress node warnings (#3259)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Jun 22, 2024
1 parent 86d4e7c commit fc9b1eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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

0 comments on commit fc9b1eb

Please sign in to comment.