From c4f7b2ac0095293d01b77c0ad15aaeaf148e1845 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 24 Sep 2024 20:49:44 -0400 Subject: [PATCH] fix(check): ignore noImplicitOverrides in remote modules (#25854) --- cli/tsc/diagnostics.rs | 4 +++- .../specs/check/remote_missing_override/__test__.jsonc | 4 ++++ tests/specs/check/remote_missing_override/main.ts | 1 + tests/testdata/check/missing_override.ts | 10 ++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/specs/check/remote_missing_override/__test__.jsonc create mode 100644 tests/specs/check/remote_missing_override/main.ts create mode 100644 tests/testdata/check/missing_override.ts diff --git a/cli/tsc/diagnostics.rs b/cli/tsc/diagnostics.rs index ac65973d8d..b0394ec177 100644 --- a/cli/tsc/diagnostics.rs +++ b/cli/tsc/diagnostics.rs @@ -140,7 +140,9 @@ impl Diagnostic { pub fn include_when_remote(&self) -> bool { /// TS6133: value is declared but its value is never read (noUnusedParameters and noUnusedLocals) const TS6133: u64 = 6133; - self.code != TS6133 + /// TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'X'. + const TS4114: u64 = 4114; + !matches!(self.code, TS6133 | TS4114) } fn fmt_category_and_code(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/tests/specs/check/remote_missing_override/__test__.jsonc b/tests/specs/check/remote_missing_override/__test__.jsonc new file mode 100644 index 0000000000..db79e37373 --- /dev/null +++ b/tests/specs/check/remote_missing_override/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check --all main.ts", + "output": "Download [WILDLINE]\nCheck [WILDLINE]\n" +} diff --git a/tests/specs/check/remote_missing_override/main.ts b/tests/specs/check/remote_missing_override/main.ts new file mode 100644 index 0000000000..e51eb63146 --- /dev/null +++ b/tests/specs/check/remote_missing_override/main.ts @@ -0,0 +1 @@ +import "http://localhost:4545/check/missing_override.ts"; diff --git a/tests/testdata/check/missing_override.ts b/tests/testdata/check/missing_override.ts new file mode 100644 index 0000000000..b3163d484a --- /dev/null +++ b/tests/testdata/check/missing_override.ts @@ -0,0 +1,10 @@ +export class Base { + method() { + } +} + +export class Derived extends Base { + // missing override keyword + method() { + } +}