Skip to content

Commit afd50e7

Browse files
authored
feat(plugin-typescript): add TS core logic (#932)
1 parent fc53905 commit afd50e7

32 files changed

+1276
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function test() {
2+
return 'test';
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const TEST = 'test';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const a = { ; // Error: TS1136: Property assignment expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// 2307 - Cannot find module.
2+
import { nonExistentModule } from './non-existent';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// 2683 - NoImplicitThis: 'this' implicitly has type 'any'.
2+
function noImplicitThisTS2683() {
3+
console.log(this.value); // Error 2683
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// 2349 - Cannot call a value that is not callable.
2+
const notCallable = 42;
3+
notCallable();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// 2531 - StrictNullChecks: Object is possibly 'null'.
2+
const strictNullChecksTS2531: string = null;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const value: NonExistentType = 42; // Compiler fails to resolve the type reference
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Standalone {
2+
override method() { // Error: TS4114 - 'override' modifier can only be used in a class derived from a base class.
3+
console.log("Standalone method");
4+
}
5+
}
6+
const s = Standalone;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { test } from '../../exclude/utils';
2+
3+
// TS6059:: File 'exclude/utils.ts' is not under 'rootDir' '.../configuration-errors'. 'rootDir' is expected to contain all source files.

0 commit comments

Comments
 (0)