diff --git a/Cargo.lock b/Cargo.lock index b361d6f0251f3..fc0f93408684a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1683,9 +1683,9 @@ dependencies = [ [[package]] name = "oxc-miette" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f02105a875f3751a0b44b4c822b01177728dd9049ae6fb419e9b04887d730ed1" +checksum = "60a7ba54c704edefead1f44e9ef09c43e5cfae666bdc33516b066011f0e6ebf7" dependencies = [ "cfg-if", "owo-colors", @@ -1698,9 +1698,9 @@ dependencies = [ [[package]] name = "oxc-miette-derive" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b4612827f6501183873fb0735da92157e3c7daa71c40921c7d2758fec2229" +checksum = "d4faecb54d0971f948fbc1918df69b26007e6f279a204793669542e1e8b75eb3" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index bc776b9710ddb..4955acc9d52fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -201,7 +201,7 @@ lazy-regex = "3.4.2" # Lazy regex compilation log = "0.4.29" # Logging facade markdown = "1.0.0" # Markdown parsing memchr = "2.7.6" # Fast byte searching -miette = { package = "oxc-miette", version = "2.6.0", features = [ +miette = { package = "oxc-miette", version = "2.7.0", features = [ "fancy-no-syscall", ] } # Error reporting mimalloc-safe = "0.1.55" # Fast allocator diff --git a/crates/oxc_diagnostics/src/lib.rs b/crates/oxc_diagnostics/src/lib.rs index 9e838aec6e541..13b11076a4e66 100644 --- a/crates/oxc_diagnostics/src/lib.rs +++ b/crates/oxc_diagnostics/src/lib.rs @@ -119,6 +119,7 @@ pub struct OxcDiagnosticInner { pub message: Cow<'static, str>, pub labels: Option>, pub help: Option>, + pub note: Option>, pub severity: Severity, pub code: OxcCode, pub url: Option>, @@ -138,6 +139,14 @@ impl Diagnostic for OxcDiagnostic { self.help.as_ref().map(Box::new).map(|c| c as Box) } + /// A note for the diagnostic. + /// + /// Similar to rustc - intended for additional explanation and information, + /// e.g. why an error was emitted, how to turn it off. + fn note<'a>(&'a self) -> Option> { + self.note.as_ref().map(Box::new).map(|c| c as Box) + } + /// The severity level of this diagnostic. /// /// Diagnostics with missing severity levels should be treated as [errors](Severity::Error). @@ -174,6 +183,7 @@ impl OxcDiagnostic { inner: Box::new(OxcDiagnosticInner { message: message.into(), labels: None, + note: None, help: None, severity: Severity::Error, code: OxcCode::default(), @@ -189,6 +199,7 @@ impl OxcDiagnostic { message: message.into(), labels: None, help: None, + note: None, severity: Severity::Warning, code: OxcCode::default(), url: None, @@ -269,6 +280,25 @@ impl OxcDiagnostic { self } + /// Show a note to the user. + /// + /// ## Example + /// ``` + /// use std::path::PathBuf; + /// use oxc_diagnostics::OxcDiagnostic + /// + /// let config_file_path = Path::from("config.json"); + /// if !config_file_path.exists() { + /// return Err(OxcDiagnostic::error("No config file found") + /// .with_help("Run my_tool --init to set up a new config file") + /// .with_note("Some useful information or suggestion")); + /// } + /// ``` + pub fn with_note>>(mut self, note: T) -> Self { + self.inner.note = Some(note.into()); + self + } + /// Set the label covering a problematic portion of source code. /// /// Existing labels will be removed. Use [`OxcDiagnostic::and_label`] append a label instead. diff --git a/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs b/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs index e714cc4b7c415..90c8873414e9e 100644 --- a/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs +++ b/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs @@ -19,7 +19,8 @@ use crate::{ fn reduce_likely_array_spread_diagnostic(spread_span: Span, reduce_span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Do not spread accumulators in Array.prototype.reduce()") - .with_help("It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead.\nUsing spreads within accumulators leads to `O(n^2)` time complexity.") + .with_help("It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead.") + .with_note("Using spreads within accumulators leads to `O(n^2)` time complexity.") .with_labels([ spread_span.label("From this spread"), reduce_span.label("For this reduce") @@ -28,7 +29,8 @@ fn reduce_likely_array_spread_diagnostic(spread_span: Span, reduce_span: Span) - fn reduce_likely_object_spread_diagnostic(spread_span: Span, reduce_span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Do not spread accumulators in Array.prototype.reduce()") - .with_help("It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead.\nUsing spreads within accumulators leads to `O(n^2)` time complexity.") + .with_help("It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead.") + .with_note("Using spreads within accumulators leads to `O(n^2)` time complexity.") .with_labels([ spread_span.label("From this spread"), reduce_span.label("For this reduce") @@ -37,7 +39,8 @@ fn reduce_likely_object_spread_diagnostic(spread_span: Span, reduce_span: Span) fn reduce_unknown(spread_span: Span, reduce_span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Do not spread accumulators in Array.prototype.reduce()") - .with_help("Consider using `Object.assign()` or `Array.prototype.push()` to mutate the accumulator instead.\nUsing spreads within accumulators leads to `O(n^2)` time complexity.") + .with_help("Consider using `Object.assign()` or `Array.prototype.push()` to mutate the accumulator instead.") + .with_note("Using spreads within accumulators leads to `O(n^2)` time complexity.") .with_labels([ spread_span.label("From this spread"), reduce_span.label("For this reduce") @@ -50,11 +53,12 @@ fn loop_spread_likely_object_diagnostic( loop_span: Span, ) -> OxcDiagnostic { OxcDiagnostic::warn("Do not spread accumulators in loops") - .with_help("Consider using `Object.assign()` to mutate the accumulator instead.\nUsing spreads within accumulators leads to `O(n^2)` time complexity.") + .with_help("Consider using `Object.assign()` to mutate the accumulator instead.") + .with_note("Using spreads within accumulators leads to `O(n^2)` time complexity.") .with_labels([ accumulator_decl_span.label("From this accumulator"), spread_span.label("From this spread"), - loop_span.label("For this loop") + loop_span.label("For this loop"), ]) } fn loop_spread_likely_array_diagnostic( @@ -63,11 +67,12 @@ fn loop_spread_likely_array_diagnostic( loop_span: Span, ) -> OxcDiagnostic { OxcDiagnostic::warn("Do not spread accumulators in loops") - .with_help("Consider using `Array.prototype.push()` to mutate the accumulator instead.\nUsing spreads within accumulators leads to `O(n^2)` time complexity.") + .with_help("Consider using `Array.prototype.push()` to mutate the accumulator instead.") + .with_note("Using spreads within accumulators leads to `O(n^2)` time complexity.") .with_labels([ accumulator_decl_span.label("From this accumulator"), spread_span.label("From this spread"), - loop_span.label("For this loop") + loop_span.label("For this loop"), ]) } diff --git a/crates/oxc_linter/src/snapshots/oxc_no_accumulating_spread.snap b/crates/oxc_linter/src/snapshots/oxc_no_accumulating_spread.snap index 62f4e56506954..0c80551b7f88e 100644 --- a/crates/oxc_linter/src/snapshots/oxc_no_accumulating_spread.snap +++ b/crates/oxc_linter/src/snapshots/oxc_no_accumulating_spread.snap @@ -9,7 +9,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:18] @@ -19,7 +19,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:18] @@ -29,7 +29,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: Consider using `Object.assign()` or `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -39,7 +39,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -49,7 +49,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:9] @@ -59,7 +59,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:9] @@ -69,7 +69,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:9] @@ -79,7 +79,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:9] @@ -89,7 +89,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:9] @@ -99,7 +99,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:9] @@ -109,7 +109,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:9] @@ -119,7 +119,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:13] @@ -129,7 +129,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -139,7 +139,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -152,7 +152,7 @@ source: crates/oxc_linter/src/tester.rs 3 │ return temp ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -162,7 +162,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -172,7 +172,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -182,7 +182,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -192,7 +192,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -202,7 +202,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -212,7 +212,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -222,7 +222,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -232,7 +232,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Array`. Consider using the `Array.push` or `Array.concat` methods to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -242,7 +242,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -252,7 +252,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -262,7 +262,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -272,7 +272,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -282,7 +282,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -292,7 +292,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -302,7 +302,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce() ╭─[no_accumulating_spread.tsx:1:5] @@ -312,7 +312,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── For this reduce ╰──── help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -323,7 +323,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -334,7 +334,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -345,7 +345,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -356,7 +356,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -367,7 +367,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -378,7 +378,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -389,7 +389,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Array.prototype.push()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -400,7 +400,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Object.assign()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -411,7 +411,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Object.assign()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -422,7 +422,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Object.assign()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -433,7 +433,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Object.assign()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -444,7 +444,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Object.assign()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -455,7 +455,7 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Object.assign()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity. ⚠ oxc(no-accumulating-spread): Do not spread accumulators in loops ╭─[no_accumulating_spread.tsx:1:5] @@ -466,4 +466,4 @@ source: crates/oxc_linter/src/tester.rs · ╰── From this accumulator ╰──── help: Consider using `Object.assign()` to mutate the accumulator instead. - Using spreads within accumulators leads to `O(n^2)` time complexity. + note: Using spreads within accumulators leads to `O(n^2)` time complexity.