strictNullChecks: First batch (#18390)

* First batch of strictNullChecks

* Remove undefined

* Check an alternative solution

* Fix strict nullChecks

* Low hanging strictNullChecks

* Fixing strict nulls issues and more

* Minor change

* fixed unit test

* Fix feedback

* Update public/vendor/ansicolor/ansicolor.ts

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

* Update public/vendor/ansicolor/ansicolor.ts

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

* Update public/vendor/ansicolor/ansicolor.ts

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

* Fix build errors
This commit is contained in:
Tobias Skarhed
2019-08-12 16:11:06 +02:00
committed by Torkel Ödegaard
parent 0b828cfa44
commit 1db9fff056
26 changed files with 143 additions and 160 deletions

View File

@@ -60,9 +60,9 @@ const clean = (obj: any) => {
/* ------------------------------------------------------------------------ */
class Color {
background: boolean;
name: string;
brightness: number;
background?: boolean;
name?: string;
brightness?: number;
constructor(background?: boolean, name?: string, brightness?: number) {
this.background = background;
@@ -82,7 +82,7 @@ class Color {
});
}
defaultBrightness(value: number) {
defaultBrightness(value?: number) {
return new Color(this.background, this.name, this.brightness || value);
}
@@ -351,7 +351,7 @@ export default class Colors {
get parsed() {
let styles: Set<string>;
let brightness: number;
let brightness: number | undefined;
let color: Color;
let bgColor: Color;