[tempfile] add linting & enable strict null checks (#18852)

* [tempfile] add linting & enable strict null checks

* [tempfile] reintroduce namespace to support import * syntax to avoid a breaking change for users
This commit is contained in:
Dimitri Benin
2017-08-11 10:16:07 -07:00
committed by Mohamed Hegazy
parent 2b74a91e5f
commit e1513dee76
4 changed files with 10 additions and 9 deletions
+6 -6
View File
@@ -1,10 +1,10 @@
// Type definitions for tempfile v1.1.0
// Type definitions for tempfile 2.0
// Project: https://github.com/sindresorhus/tempfile
// Definitions by: Sam Verschueren <https://github.com/SamVerschueren>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "tempfile" {
function tempfile(extension?: string): string;
module tempfile {}
export = tempfile;
}
export = tempfile;
declare function tempfile(extension?: string): string;
declare namespace tempfile {}
+1 -1
View File
@@ -1,4 +1,4 @@
import tempfile = require('tempfile');
tempfile();
tempfile(); // $ExpectType string
tempfile('.png');
+2 -2
View File
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
@@ -19,4 +19,4 @@
"index.d.ts",
"tempfile-tests.ts"
]
}
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }