diff --git a/__tests__/__fixtures__/typecheck.ts b/__tests__/__fixtures__/typecheck.ts index aaa1263..1664ba5 100644 --- a/__tests__/__fixtures__/typecheck.ts +++ b/__tests__/__fixtures__/typecheck.ts @@ -32,6 +32,17 @@ const cssWithFallbackValues: CSS.PropertiesFallback = { clip: [undefined], }; +const cssWithFallbackConstValues: CSS.PropertiesFallback = { + flexGrow: [1] as const, + flexShrink: [1] as const, + flexBasis: ['max-content'] as const, + flexDirection: ['row'] as const, + MozAppearance: ['button'] as const, + msOverflowStyle: ['scrollbar'] as const, + height: undefined, + clip: [undefined] as const, +}; + const cssWithHyphenProperties: CSS.PropertiesHyphen = { 'flex-grow': 1, 'flex-shrink': 0, @@ -149,6 +160,7 @@ const differentMajorVersions: CSS.Properties = {} as OldCSS.Properties; css; cssWithFallbackValues; +cssWithFallbackConstValues; cssWithHyphenProperties; cssWithDifferentLength; unknownProperty; diff --git a/__tests__/__snapshots__/dist.typescript-3.5.ts.snap b/__tests__/__snapshots__/dist.typescript-3.5.ts.snap index 18c20f5..2016402 100644 --- a/__tests__/__snapshots__/dist.typescript-3.5.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-3.5.ts.snap @@ -1,58 +1,64 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.5 detects errors 1`] = ` -"31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | HyphenateCharacter[] | undefined'. - Type 'undefined[]' is not assignable to type 'HyphenateCharacter[]'. +"31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'undefined[]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.5 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. - Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." +"42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. + Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.5 detects errors 3`] = ` -"52:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. - Type 'number[]' is not assignable to type '"unset"'." +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. + Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.5 detects errors 4`] = ` -"53:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. +"63:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.5 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. - Type '{}' is not assignable to type 'string'." +"64:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. + Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.5 detects errors 6`] = ` -"63:10 - Type 'Range' is not assignable to type '"auto"'. +"69:6 - Type '{}' is not assignable to type 'string & {}'. + Type '{}' is not assignable to type 'string'." +`; + +exports[`Typescript 3.5 detects errors 7`] = ` +"74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 3.5 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 3.5 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 3.5 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.5 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.5 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.5 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.5 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 3.5 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 3.5 detects errors 11`] = ` -"107:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. +exports[`Typescript 3.5 detects errors 12`] = ` +"118:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. Type '1[]' is not assignable to type '(string | 0)[]'. Type '1' is not assignable to type 'string | 0'." `; -exports[`Typescript 3.5 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.5 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.5 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.5 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.5 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; +exports[`Typescript 3.5 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; -exports[`Typescript 3.5 detects errors 15`] = ` -"145:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. +exports[`Typescript 3.5 detects errors 16`] = ` +"156:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. Type '[1]' is not assignable to type '[0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"]'. Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'." `; diff --git a/__tests__/__snapshots__/dist.typescript-3.6.ts.snap b/__tests__/__snapshots__/dist.typescript-3.6.ts.snap index d704740..79b0d62 100644 --- a/__tests__/__snapshots__/dist.typescript-3.6.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-3.6.ts.snap @@ -1,58 +1,64 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.6 detects errors 1`] = ` -"31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | HyphenateCharacter[] | undefined'. - Type 'undefined[]' is not assignable to type 'HyphenateCharacter[]'. +"31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'undefined[]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.6 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. - Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." +"42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. + Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.6 detects errors 3`] = ` -"52:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. - Type 'number[]' is not assignable to type '"unset"'." +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. + Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.6 detects errors 4`] = ` -"53:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. +"63:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.6 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. - Type '{}' is not assignable to type 'string'." +"64:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. + Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.6 detects errors 6`] = ` -"63:10 - Type 'Range' is not assignable to type '"auto"'. +"69:6 - Type '{}' is not assignable to type 'string & {}'. + Type '{}' is not assignable to type 'string'." +`; + +exports[`Typescript 3.6 detects errors 7`] = ` +"74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 3.6 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 3.6 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 3.6 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.6 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.6 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.6 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.6 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 3.6 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 3.6 detects errors 11`] = ` -"107:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. +exports[`Typescript 3.6 detects errors 12`] = ` +"118:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. Type '1[]' is not assignable to type '(string | 0)[]'. Type '1' is not assignable to type 'string | 0'." `; -exports[`Typescript 3.6 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.6 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.6 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.6 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.6 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; +exports[`Typescript 3.6 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; -exports[`Typescript 3.6 detects errors 15`] = ` -"145:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. +exports[`Typescript 3.6 detects errors 16`] = ` +"156:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. Type '[1]' is not assignable to type '[0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"]'. Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'." `; diff --git a/__tests__/__snapshots__/dist.typescript-3.7.ts.snap b/__tests__/__snapshots__/dist.typescript-3.7.ts.snap index 337298a..cedb253 100644 --- a/__tests__/__snapshots__/dist.typescript-3.7.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-3.7.ts.snap @@ -1,58 +1,64 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.7 detects errors 1`] = ` -"31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | HyphenateCharacter[] | undefined'. - Type 'undefined[]' is not assignable to type 'HyphenateCharacter[]'. +"31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'undefined[]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.7 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. - Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." +"42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. + Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.7 detects errors 3`] = ` -"52:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. - Type 'number[]' is not assignable to type '"unset"'." +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. + Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.7 detects errors 4`] = ` -"53:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. +"63:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.7 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. - Type '{}' is not assignable to type 'string'." +"64:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. + Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.7 detects errors 6`] = ` -"63:10 - Type 'Range' is not assignable to type '"auto"'. +"69:6 - Type '{}' is not assignable to type 'string & {}'. + Type '{}' is not assignable to type 'string'." +`; + +exports[`Typescript 3.7 detects errors 7`] = ` +"74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 3.7 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 3.7 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 3.7 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.7 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.7 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.7 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.7 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 3.7 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 3.7 detects errors 11`] = ` -"107:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. +exports[`Typescript 3.7 detects errors 12`] = ` +"118:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. Type '1[]' is not assignable to type '(string | 0)[]'. Type '1' is not assignable to type 'string | 0'." `; -exports[`Typescript 3.7 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.7 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.7 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.7 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.7 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; +exports[`Typescript 3.7 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; -exports[`Typescript 3.7 detects errors 15`] = ` -"145:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. +exports[`Typescript 3.7 detects errors 16`] = ` +"156:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. Type '[1]' is not assignable to type '[0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"]'. Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'." `; diff --git a/__tests__/__snapshots__/dist.typescript-3.8.ts.snap b/__tests__/__snapshots__/dist.typescript-3.8.ts.snap index f57844e..a1e841a 100644 --- a/__tests__/__snapshots__/dist.typescript-3.8.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-3.8.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 3.8 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 3.8 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. + Type 'undefined' is not assignable to type 'HyphenateCharacter'." +`; + +exports[`Typescript 3.8 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 3.8 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 3.8 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 3.8 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 3.8 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 3.8 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 3.8 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 3.8 detects errors 6`] = ` -"63:10 - Type 'Range' is not assignable to type '"auto"'. +exports[`Typescript 3.8 detects errors 7`] = ` +"74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 3.8 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 3.8 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 3.8 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.8 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.8 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.8 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.8 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 3.8 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 3.8 detects errors 11`] = `"107:15 - Type 'number' is not assignable to type 'string | 0'."`; +exports[`Typescript 3.8 detects errors 12`] = `"118:15 - Type 'number' is not assignable to type 'string | 0'."`; -exports[`Typescript 3.8 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.8 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.8 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.8 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.8 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; +exports[`Typescript 3.8 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; -exports[`Typescript 3.8 detects errors 15`] = `"145:35 - Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'."`; +exports[`Typescript 3.8 detects errors 16`] = `"156:35 - Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'."`; diff --git a/__tests__/__snapshots__/dist.typescript-3.9.ts.snap b/__tests__/__snapshots__/dist.typescript-3.9.ts.snap index fbfa470..f39bdd0 100644 --- a/__tests__/__snapshots__/dist.typescript-3.9.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-3.9.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 3.9 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 3.9 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. + Type 'undefined' is not assignable to type 'HyphenateCharacter'." +`; + +exports[`Typescript 3.9 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 3.9 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 3.9 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 3.9 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 3.9 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 3.9 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 3.9 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 3.9 detects errors 6`] = ` -"63:10 - Type 'Range' is not assignable to type '"auto"'. +exports[`Typescript 3.9 detects errors 7`] = ` +"74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 3.9 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 3.9 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 3.9 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.9 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.9 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.9 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.9 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 3.9 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 3.9 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 3.9 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 3.9 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 3.9 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 3.9 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 3.9 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 3.9 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; +exports[`Typescript 3.9 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; -exports[`Typescript 3.9 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 3.9 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.0.ts.snap b/__tests__/__snapshots__/dist.typescript-4.0.ts.snap index e54b418..b4507e0 100644 --- a/__tests__/__snapshots__/dist.typescript-4.0.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.0.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.0 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 4.0 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. + Type 'undefined' is not assignable to type 'HyphenateCharacter'." +`; + +exports[`Typescript 4.0 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.0 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.0 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.0 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.0 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.0 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.0 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.0 detects errors 6`] = ` -"63:10 - Type 'Range' is not assignable to type '"auto"'. +exports[`Typescript 4.0 detects errors 7`] = ` +"74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.0 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.0 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.0 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.0 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.0 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.0 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.0 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.0 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.0 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.0 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.0 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.0 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.0 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.0 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.0 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; +exports[`Typescript 4.0 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; -exports[`Typescript 4.0 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.0 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.1.ts.snap b/__tests__/__snapshots__/dist.typescript-4.1.ts.snap index 6b38292..65515a2 100644 --- a/__tests__/__snapshots__/dist.typescript-4.1.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.1.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.1 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 4.1 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. + Type 'undefined' is not assignable to type 'HyphenateCharacter'." +`; + +exports[`Typescript 4.1 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.1 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.1 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.1 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.1 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.1 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.1 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.1 detects errors 6`] = ` -"63:10 - Type 'Range' is not assignable to type '"auto"'. +exports[`Typescript 4.1 detects errors 7`] = ` +"74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.1 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.1 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.1 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.1 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.1 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.1 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.1 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.1 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.1 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.1 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.1 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.1 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.1 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.1 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.1 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; +exports[`Typescript 4.1 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; -exports[`Typescript 4.1 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.1 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.2.ts.snap b/__tests__/__snapshots__/dist.typescript-4.2.ts.snap index f82bd18..d158ddc 100644 --- a/__tests__/__snapshots__/dist.typescript-4.2.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.2.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.2 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.2 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. + Type 'undefined' is not assignable to type 'Clip'." +`; + +exports[`Typescript 4.2 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.2 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.2 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.2 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.2 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.2 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.2 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.2 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.2 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.2 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.2 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.2 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.2 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.2 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.2 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.2 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.2 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.2 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.2 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.2 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.2 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.2 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.2 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.2 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.2 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.2 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.2 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.3.ts.snap b/__tests__/__snapshots__/dist.typescript-4.3.ts.snap index f362d0f..8f964a0 100644 --- a/__tests__/__snapshots__/dist.typescript-4.3.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.3.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.3 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.3 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. + Type 'undefined' is not assignable to type 'Clip'." +`; + +exports[`Typescript 4.3 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.3 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.3 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.3 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.3 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.3 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.3 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.3 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.3 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.3 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.3 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.3 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.3 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.3 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.3 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.3 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.3 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.3 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.3 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.3 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.3 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.3 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.3 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.3 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.3 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.3 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.3 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.4.ts.snap b/__tests__/__snapshots__/dist.typescript-4.4.ts.snap index e1162d0..dbc94fe 100644 --- a/__tests__/__snapshots__/dist.typescript-4.4.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.4.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.4 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.4 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. + Type 'undefined' is not assignable to type 'Clip'." +`; + +exports[`Typescript 4.4 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.4 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.4 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.4 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.4 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.4 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.4 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.4 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.4 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.4 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.4 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.4 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.4 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.4 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.4 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.4 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.4 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.4 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.4 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.4 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.4 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.4 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.4 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.4 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.4 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.4 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.4 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.5.ts.snap b/__tests__/__snapshots__/dist.typescript-4.5.ts.snap index a715679..334ebca 100644 --- a/__tests__/__snapshots__/dist.typescript-4.5.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.5.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.5 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.5 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. + Type 'undefined' is not assignable to type 'Clip'." +`; + +exports[`Typescript 4.5 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.5 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.5 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.5 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.5 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.5 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.5 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.5 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.5 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.5 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.5 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.5 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.5 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.5 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.5 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.5 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.5 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.5 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.5 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.5 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.5 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.5 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.5 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.5 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.5 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.5 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.5 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.6.ts.snap b/__tests__/__snapshots__/dist.typescript-4.6.ts.snap index 6762be5..5607e69 100644 --- a/__tests__/__snapshots__/dist.typescript-4.6.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.6.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.6 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.6 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. + Type 'undefined' is not assignable to type 'Clip'." +`; + +exports[`Typescript 4.6 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.6 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.6 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.6 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.6 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.6 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.6 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.6 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.6 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.6 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.6 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.6 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.6 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.6 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.6 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.6 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.6 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.6 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.6 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.6 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.6 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.6 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.6 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.6 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.6 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.6 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.6 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.7.ts.snap b/__tests__/__snapshots__/dist.typescript-4.7.ts.snap index 0e4b9e3..71d6ffe 100644 --- a/__tests__/__snapshots__/dist.typescript-4.7.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.7.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.7 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.7 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. + Type 'undefined' is not assignable to type 'Clip'." +`; + +exports[`Typescript 4.7 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.7 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.7 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.7 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.7 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.7 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.7 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.7 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.7 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.7 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.7 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.7 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.7 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.7 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.7 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.7 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.7 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.7 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.7 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.7 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.7 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.7 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.7 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.7 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.7 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.7 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.7 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.8.ts.snap b/__tests__/__snapshots__/dist.typescript-4.8.ts.snap index 02afef9..2867092 100644 --- a/__tests__/__snapshots__/dist.typescript-4.8.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.8.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.8 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'string'."`; exports[`Typescript 4.8 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'readonly string[] | Clip | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly string[]'. + Type 'undefined' is not assignable to type 'string'." +`; + +exports[`Typescript 4.8 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.8 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.8 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.8 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.8 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.8 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.8 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.8 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.8 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.8 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.8 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.8 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.8 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.8 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.8 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.8 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.8 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.8 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.8 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.8 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.8 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.8 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.8 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.8 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.8 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.8 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.8 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-4.9.ts.snap b/__tests__/__snapshots__/dist.typescript-4.9.ts.snap index 39a6e5d..fff5036 100644 --- a/__tests__/__snapshots__/dist.typescript-4.9.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-4.9.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 4.9 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'string'."`; exports[`Typescript 4.9 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'readonly string[] | Clip | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly string[]'. + Type 'undefined' is not assignable to type 'string'." +`; + +exports[`Typescript 4.9 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 4.9 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.9 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.9 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 4.9 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 4.9 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 4.9 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 4.9 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 4.9 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 4.9 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.9 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.9 detects errors 8`] = `"82:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.9 detects errors 9`] = `"93:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.9 detects errors 9`] = `"96:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.9 detects errors 10`] = `"107:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.9 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 4.9 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 4.9 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 4.9 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 4.9 detects errors 12`] = `"120:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 4.9 detects errors 13`] = `"131:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 4.9 detects errors 13`] = `"134:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 4.9 detects errors 14`] = `"145:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 4.9 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 4.9 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 4.9 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 4.9 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/__snapshots__/dist.typescript-latest.ts.snap b/__tests__/__snapshots__/dist.typescript-latest.ts.snap index 2993c10..b485663 100644 --- a/__tests__/__snapshots__/dist.typescript-latest.ts.snap +++ b/__tests__/__snapshots__/dist.typescript-latest.ts.snap @@ -3,38 +3,44 @@ exports[`Typescript 5.0 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'string'."`; exports[`Typescript 5.0 detects errors 2`] = ` -"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. +"42:2 - Type 'readonly [undefined]' is not assignable to type 'readonly string[] | Clip | undefined'. + Type 'readonly [undefined]' is not assignable to type 'readonly string[]'. + Type 'undefined' is not assignable to type 'string'." +`; + +exports[`Typescript 5.0 detects errors 3`] = ` +"59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; -exports[`Typescript 5.0 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 5.0 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 5.0 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; +exports[`Typescript 5.0 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; -exports[`Typescript 5.0 detects errors 5`] = ` -"58:6 - Type '{}' is not assignable to type 'string & {}'. +exports[`Typescript 5.0 detects errors 6`] = ` +"69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; -exports[`Typescript 5.0 detects errors 6`] = ` -"63:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. +exports[`Typescript 5.0 detects errors 7`] = ` +"74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; -exports[`Typescript 5.0 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 5.0 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 5.0 detects errors 8`] = `"82:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 5.0 detects errors 9`] = `"93:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 5.0 detects errors 9`] = `"96:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 5.0 detects errors 10`] = `"107:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 5.0 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; +exports[`Typescript 5.0 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; -exports[`Typescript 5.0 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; +exports[`Typescript 5.0 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; -exports[`Typescript 5.0 detects errors 12`] = `"120:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; +exports[`Typescript 5.0 detects errors 13`] = `"131:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; -exports[`Typescript 5.0 detects errors 13`] = `"134:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; +exports[`Typescript 5.0 detects errors 14`] = `"145:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; -exports[`Typescript 5.0 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; +exports[`Typescript 5.0 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; -exports[`Typescript 5.0 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; +exports[`Typescript 5.0 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; diff --git a/__tests__/dist.typescript-3.5.ts b/__tests__/dist.typescript-3.5.ts index d5e07a0..a3a6a0b 100644 --- a/__tests__/dist.typescript-3.5.ts +++ b/__tests__/dist.typescript-3.5.ts @@ -14,7 +14,7 @@ describe('Typescript 3.5', () => { }); expect(Number(ts.versionMajorMinor)).toBe(3.5); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-3.6.ts b/__tests__/dist.typescript-3.6.ts index d19b516..dfb02fe 100644 --- a/__tests__/dist.typescript-3.6.ts +++ b/__tests__/dist.typescript-3.6.ts @@ -14,7 +14,7 @@ describe('Typescript 3.6', () => { }); expect(Number(ts.versionMajorMinor)).toBe(3.6); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-3.7.ts b/__tests__/dist.typescript-3.7.ts index 58e9015..a49293d 100644 --- a/__tests__/dist.typescript-3.7.ts +++ b/__tests__/dist.typescript-3.7.ts @@ -14,7 +14,7 @@ describe('Typescript 3.7', () => { }); expect(Number(ts.versionMajorMinor)).toBe(3.7); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-3.8.ts b/__tests__/dist.typescript-3.8.ts index 9ab85a6..3752258 100644 --- a/__tests__/dist.typescript-3.8.ts +++ b/__tests__/dist.typescript-3.8.ts @@ -14,7 +14,7 @@ describe('Typescript 3.8', () => { }); expect(Number(ts.versionMajorMinor)).toBe(3.8); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-3.9.ts b/__tests__/dist.typescript-3.9.ts index b3f86e6..1615118 100644 --- a/__tests__/dist.typescript-3.9.ts +++ b/__tests__/dist.typescript-3.9.ts @@ -14,7 +14,7 @@ describe('Typescript 3.9', () => { }); expect(Number(ts.versionMajorMinor)).toBe(3.9); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.0.ts b/__tests__/dist.typescript-4.0.ts index f8c6c65..6752f72 100644 --- a/__tests__/dist.typescript-4.0.ts +++ b/__tests__/dist.typescript-4.0.ts @@ -14,7 +14,7 @@ describe('Typescript 4.0', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.0); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.1.ts b/__tests__/dist.typescript-4.1.ts index af578dd..0c48b3e 100644 --- a/__tests__/dist.typescript-4.1.ts +++ b/__tests__/dist.typescript-4.1.ts @@ -14,7 +14,7 @@ describe('Typescript 4.1', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.1); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.2.ts b/__tests__/dist.typescript-4.2.ts index 94f3ab3..350bdda 100644 --- a/__tests__/dist.typescript-4.2.ts +++ b/__tests__/dist.typescript-4.2.ts @@ -14,7 +14,7 @@ describe('Typescript 4.2', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.2); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.3.ts b/__tests__/dist.typescript-4.3.ts index c12be66..5373ba2 100644 --- a/__tests__/dist.typescript-4.3.ts +++ b/__tests__/dist.typescript-4.3.ts @@ -14,7 +14,7 @@ describe('Typescript 4.3', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.3); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.4.ts b/__tests__/dist.typescript-4.4.ts index 2cee6bc..2b514e3 100644 --- a/__tests__/dist.typescript-4.4.ts +++ b/__tests__/dist.typescript-4.4.ts @@ -14,7 +14,7 @@ describe('Typescript 4.4', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.4); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.5.ts b/__tests__/dist.typescript-4.5.ts index 426ac2f..0f3061f 100644 --- a/__tests__/dist.typescript-4.5.ts +++ b/__tests__/dist.typescript-4.5.ts @@ -14,7 +14,7 @@ describe('Typescript 4.5', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.5); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.6.ts b/__tests__/dist.typescript-4.6.ts index 76029cc..9bbd2b9 100644 --- a/__tests__/dist.typescript-4.6.ts +++ b/__tests__/dist.typescript-4.6.ts @@ -14,7 +14,7 @@ describe('Typescript 4.6', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.6); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.7.ts b/__tests__/dist.typescript-4.7.ts index ad2775a..a713b48 100644 --- a/__tests__/dist.typescript-4.7.ts +++ b/__tests__/dist.typescript-4.7.ts @@ -14,7 +14,7 @@ describe('Typescript 4.7', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.7); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.8.ts b/__tests__/dist.typescript-4.8.ts index 4bf5b0e..5387ceb 100644 --- a/__tests__/dist.typescript-4.8.ts +++ b/__tests__/dist.typescript-4.8.ts @@ -14,7 +14,7 @@ describe('Typescript 4.8', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.8); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-4.9.ts b/__tests__/dist.typescript-4.9.ts index 6ad8c03..8a38004 100644 --- a/__tests__/dist.typescript-4.9.ts +++ b/__tests__/dist.typescript-4.9.ts @@ -14,7 +14,7 @@ describe('Typescript 4.9', () => { }); expect(Number(ts.versionMajorMinor)).toBe(4.9); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/__tests__/dist.typescript-latest.ts b/__tests__/dist.typescript-latest.ts index 3f17cb3..6447731 100644 --- a/__tests__/dist.typescript-latest.ts +++ b/__tests__/dist.typescript-latest.ts @@ -14,7 +14,7 @@ describe('Typescript 5.0', () => { }); expect(Number(ts.versionMajorMinor)).toBe(5.0); - expect(errors.length).toBe(15); + expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } diff --git a/index.d.ts b/index.d.ts index 4f83c67..0f6ced6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,7 +6,7 @@ export type PropertyValue = TValue extends Array ? TUnpacked : TValue; -export type Fallback = { [P in keyof T]: T[P] | NonNullable[] }; +export type Fallback = { [P in keyof T]: T[P] | readonly NonNullable[] }; export interface StandardLonghandProperties { /** diff --git a/src/typescript.ts b/src/typescript.ts index 5bd965b..ac369b2 100644 --- a/src/typescript.ts +++ b/src/typescript.ts @@ -70,7 +70,7 @@ export default async function typescript() { 'TValue extends infer TUnpacked & {} ? TUnpacked : TValue' + ';' + EOL; - const fallback = 'export type Fallback = { [P in keyof T]: T[P] | NonNullable[] };' + EOL; + const fallback = 'export type Fallback = { [P in keyof T]: T[P] | readonly NonNullable[] };' + EOL; return ( disableAutoExport +