From e1513dee766846fa78534542607fb2d33d5ccc22 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Fri, 11 Aug 2017 19:16:07 +0200 Subject: [PATCH] [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 --- types/tempfile/index.d.ts | 12 ++++++------ types/tempfile/tempfile-tests.ts | 2 +- types/tempfile/tsconfig.json | 4 ++-- types/tempfile/tslint.json | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 types/tempfile/tslint.json diff --git a/types/tempfile/index.d.ts b/types/tempfile/index.d.ts index 25544e4fd9..5d59f5d7d8 100644 --- a/types/tempfile/index.d.ts +++ b/types/tempfile/index.d.ts @@ -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 +// 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 {} diff --git a/types/tempfile/tempfile-tests.ts b/types/tempfile/tempfile-tests.ts index 8e32021f3d..b614a4a283 100644 --- a/types/tempfile/tempfile-tests.ts +++ b/types/tempfile/tempfile-tests.ts @@ -1,4 +1,4 @@ import tempfile = require('tempfile'); -tempfile(); +tempfile(); // $ExpectType string tempfile('.png'); diff --git a/types/tempfile/tsconfig.json b/types/tempfile/tsconfig.json index a39b2cdcb1..0a2e750fbb 100644 --- a/types/tempfile/tsconfig.json +++ b/types/tempfile/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +19,4 @@ "index.d.ts", "tempfile-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/tempfile/tslint.json b/types/tempfile/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/tempfile/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }