Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": ["eslint", "typescript", "react"],
"categories": {
"correctness": "off"
},
"rules": {
"react/exhaustive-deps": "warn",
"typescript/no-unsafe-declaration-merging": "error"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ function Component() {
}, []);

return null;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// oxlint-disable-next-line typescript/no-unsafe-declaration-merging
export interface Component {}

export abstract class Component {}

// oxlint-disable-next-line typescript/no-unsafe-declaration-merging
export abstract class Component2 {}

export interface Component2 {}

This file was deleted.

6 changes: 3 additions & 3 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,13 +1252,13 @@ mod test {
}

#[test]
fn test_exhaustive_deps_disable_directive_issue_13311() {
fn test_disable_directive_issue_13311() {
// Test that exhaustive-deps diagnostics are reported at the dependency array
// so that disable directives work correctly
// Issue: https://github.com/oxc-project/oxc/issues/13311
let args = &["test.jsx"];
let args = &["test.jsx", "test2.d.ts"];
Tester::new()
.with_cwd("fixtures/exhaustive_deps_disable_directive_issue_13311".into())
.with_cwd("fixtures/disable_directive_issue_13311".into())
.test_and_snapshot(args);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: apps/oxlint/src/tester.rs
---
##########
arguments: test.jsx test2.d.ts
working directory: fixtures/disable_directive_issue_13311
----------
Found 0 warnings and 0 errors.
Finished in <variable>ms on 2 files using 1 threads.
----------
CLI result: LintSucceeded
----------

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
fn no_unsafe_declaration_merging_diagnostic(span: Span, span1: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Unsafe declaration merging between classes and interfaces.")
.with_help("The TypeScript compiler doesn't check whether properties are initialized, which can lead to TypeScript not detecting code that will cause runtime errors.")
.with_labels([span, span1])
.with_labels(if span < span1 { [span, span1]} else { [span1, span] })
}

#[derive(Debug, Default, Clone)]
Expand Down
Loading