From 3860b64345b459ee76d985e10969321ac55a87a7 Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 14 Nov 2017 11:49:52 +0900 Subject: [PATCH] Enable strictNullChecks --- types/js-yaml/index.d.ts | 2 +- types/js-yaml/js-yaml-tests.ts | 10 +++++----- types/js-yaml/tsconfig.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index d01f272661..70e43b5067 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -7,7 +7,7 @@ export function safeLoad(str: string, opts?: LoadOptions): any; export function load(str: string, opts?: LoadOptions): any; -export class Type implements TypeConstructorOptions { +export class Type { constructor(tag: string, opts?: TypeConstructorOptions); kind: 'sequence' | 'scalar' | 'mapping' | null; resolve(data: any): boolean; diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 9cb457b98e..13931a81df 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -87,19 +87,19 @@ dumpOpts = { // $ExpectType Type new yaml.Type(str, typeConstructorOptions); -// $ExpectType "sequence" | "scalar" | "mapping" +// $ExpectType "sequence" | "scalar" | "mapping" | null type.kind; // $ExpectType (data: any) => boolean type.resolve; // $ExpectType (data: any) => any type.construct; -// $ExpectType object +// $ExpectType object | null type.instanceOf; -// $ExpectType string +// $ExpectType string | null type.predicate; -// $ExpectType ((data: object) => any) | { [x: string]: (data: object) => any; } +// $ExpectType ((data: object) => any) | { [x: string]: (data: object) => any; } | null type.represent; -// $ExpectType string +// $ExpectType string | null type.defaultStyle; // $ExpectType { [x: string]: any; } type.styleAliases; diff --git a/types/js-yaml/tsconfig.json b/types/js-yaml/tsconfig.json index b1e787d1b3..c36931fa61 100644 --- a/types/js-yaml/tsconfig.json +++ b/types/js-yaml/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "js-yaml-tests.ts" ] -} \ No newline at end of file +}