Skip to content

Commit c036f9e

Browse files
committed
chore(package): Upgrade to TS 3.0.
And support a TS 3.0 peer.
1 parent 92159bd commit c036f9e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"tape": "^4.7.0",
2222
"ts-node": "^7.0.0",
2323
"tslint": "^5.5.0",
24-
"typescript": "~2.9.1"
24+
"typescript": "~3.0.1"
2525
},
2626
"es2015": "./dist/esm2015/index.js",
2727
"homepage": "https://github.com/cartant/ts-snippet",
@@ -37,7 +37,7 @@
3737
"name": "ts-snippet",
3838
"optionalDependencies": {},
3939
"peerDependencies": {
40-
"typescript": "^2.1.0"
40+
"typescript": "^2.1.0 || ^3.0.0"
4141
},
4242
"private": true,
4343
"repository": {

source/compiler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export class Compiler {
7676
this._files[fileName].content = files[fileName];
7777
this._files[fileName].version++;
7878
});
79-
return this._languageService.getProgram();
79+
const program = this._languageService.getProgram();
80+
if (!program) {
81+
throw new Error("No program.");
82+
}
83+
return program;
8084
}
8185

8286
formatDiagnostic(diagnostic: ts.Diagnostic): string {

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3392,9 +3392,9 @@ type-detect@^4.0.0:
33923392
version "4.0.8"
33933393
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
33943394

3395-
typescript@~2.9.1:
3396-
version "2.9.2"
3397-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
3395+
typescript@~3.0.1:
3396+
version "3.0.1"
3397+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb"
33983398

33993399
uid2@0.0.3:
34003400
version "0.0.3"

0 commit comments

Comments
 (0)