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
3 changes: 2 additions & 1 deletion crates/oxc_semantic/src/checker/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ fn constructor_implementation_missing(span: Span) -> OxcDiagnostic {
}

fn function_implementation_missing(span: Span) -> OxcDiagnostic {
OxcDiagnostic::error(
ts_error(
"2391",
"Function implementation is missing or not immediately following the declaration.",
)
.with_label(span)
Expand Down
36 changes: 18 additions & 18 deletions tasks/coverage/snapshots/parser_babel.snap
Original file line number Diff line number Diff line change
Expand Up @@ -451,23 +451,23 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts:2:5]
1 │ class C {
2 │ public(): void;
· ──────
3 │ public static(): void;
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts:3:12]
2 │ public(): void;
3 │ public static(): void;
· ──────
4 │ readonly = 0;
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts:5:5]
4 │ readonly = 0;
5 │ async<T>(): void;
Expand All @@ -477,23 +477,23 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/input.ts

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/input.ts:2:5]
1 │ class C {
2 │ public(): void;
· ──────
3 │ public static(): void;
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/input.ts:3:12]
2 │ public(): void;
3 │ public static(): void;
· ──────
4 │ readonly = 0;
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/input.ts:5:5]
4 │ readonly = 0;
5 │ async<T>(): void;
Expand All @@ -503,7 +503,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/input.ts

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/input.ts:2:12]
1 │ class C {
2 │ public delete(): void;
Expand All @@ -513,7 +513,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/method-no-body/input.ts

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/method-no-body/input.ts:3:5]
2 │ f();
3 │ f(): void;
Expand All @@ -523,15 +523,15 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/input.ts

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/input.ts:3:5]
2 │ {
3 │ m()
· ─
4 │ n()
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/input.ts:4:5]
3 │ m()
4 │ n()
Expand Down Expand Up @@ -639,7 +639,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/static/input.ts

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/static/input.ts:5:20]
4 │ protected static f();
5 │ private static f();
Expand Down Expand Up @@ -12533,23 +12533,23 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
╰────
help: Allowed modifiers are: private, protected, public, static, abstract, override, async

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/estree/typescript/invalid-class-method-empty-body/input.js:2:3]
1 │ class C {
2 │ method();
· ──────
3 │ #method();
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/estree/typescript/invalid-class-method-empty-body/input.js:3:3]
2 │ method();
3 │ #method();
· ───────
4 │ declare method();
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/estree/typescript/invalid-class-method-empty-body/input.js:4:11]
3 │ #method();
4 │ declare method();
Expand All @@ -12566,23 +12566,23 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
╰────
help: Allowed modifiers are: private, protected, public, static, abstract, override, async

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/estree/typescript/invalid-class-method-empty-body-babel-7/input.js:2:3]
1 │ class C {
2 │ method();
· ──────
3 │ #method();
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/estree/typescript/invalid-class-method-empty-body-babel-7/input.js:3:3]
2 │ method();
3 │ #method();
· ───────
4 │ declare method();
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/estree/typescript/invalid-class-method-empty-body-babel-7/input.js:4:11]
3 │ #method();
4 │ declare method();
Expand Down Expand Up @@ -13073,7 +13073,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
4 │ }
╰────

× Function implementation is missing or not immediately following the declaration.
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/declare-accessor/input.ts:3:15]
2 │ declare get foo()
3 │ declare set foo(v)
Expand Down
Loading
Loading