From 26cc99b92d63540bbd7792415a9f82a1e9936106 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 14 Feb 2016 18:41:38 -0800 Subject: [PATCH] Introduce -strictNullChecks compiler option --- src/compiler/commandLineParser.ts | 5 +++++ src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/types.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 86d073f7d49..bdc586b6037 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -326,6 +326,11 @@ namespace ts { name: "noImplicitUseStrict", type: "boolean", description: Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "strictNullChecks", + type: "boolean", + description: Diagnostics.Enable_strict_null_checks } ]; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 25b86e67d34..6978a9ad611 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2576,6 +2576,10 @@ "category": "Message", "code": 6112 }, + "Enable strict null checks.": { + "category": "Message", + "code": 6113 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6b9f49cac01..3e59a623c2f 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2420,6 +2420,7 @@ namespace ts { allowSyntheticDefaultImports?: boolean; allowJs?: boolean; noImplicitUseStrict?: boolean; + strictNullChecks?: boolean; /* @internal */ stripInternal?: boolean; // Skip checking lib.d.ts to help speed up tests.