a4c683be12
* Again: Improve error messages for empty DOM interface property access * containerSeemsToBeEmptyDomElement Co-authored-by: Daniel Rosenwasser <drosenwasser@microsoft.com> * isEmptyObjectType; unescapeLeadingUnderscores * Single tick quotes for now * Undo accidental diagnostic change * Correct new baseline Co-authored-by: Daniel Rosenwasser <drosenwasser@microsoft.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
39 lines
2.6 KiB
Plaintext
39 lines
2.6 KiB
Plaintext
tests/cases/compiler/missingDomElements.ts(6,24): error TS2812: Property 'textContent' does not exist on type 'Element'. Try changing the 'lib' compiler option to include 'dom'.
|
|
tests/cases/compiler/missingDomElements.ts(7,28): error TS2812: Property 'textContent' does not exist on type 'HTMLElement'. Try changing the 'lib' compiler option to include 'dom'.
|
|
tests/cases/compiler/missingDomElements.ts(8,33): error TS2812: Property 'textContent' does not exist on type 'HTMLInputElement'. Try changing the 'lib' compiler option to include 'dom'.
|
|
tests/cases/compiler/missingDomElements.ts(9,47): error TS2812: Property 'textContent' does not exist on type 'EventTarget & HTMLInputElement'. Try changing the 'lib' compiler option to include 'dom'.
|
|
tests/cases/compiler/missingDomElements.ts(16,32): error TS2339: Property 'textContent' does not exist on type 'HTMLElementFake'.
|
|
tests/cases/compiler/missingDomElements.ts(17,21): error TS2339: Property 'textContent' does not exist on type 'Node'.
|
|
|
|
|
|
==== tests/cases/compiler/missingDomElements.ts (6 errors) ====
|
|
interface Element {}
|
|
interface EventTarget {}
|
|
interface HTMLElement {}
|
|
interface HTMLInputElement {}
|
|
|
|
({} as any as Element).textContent;
|
|
~~~~~~~~~~~
|
|
!!! error TS2812: Property 'textContent' does not exist on type 'Element'. Try changing the 'lib' compiler option to include 'dom'.
|
|
({} as any as HTMLElement).textContent;
|
|
~~~~~~~~~~~
|
|
!!! error TS2812: Property 'textContent' does not exist on type 'HTMLElement'. Try changing the 'lib' compiler option to include 'dom'.
|
|
({} as any as HTMLInputElement).textContent;
|
|
~~~~~~~~~~~
|
|
!!! error TS2812: Property 'textContent' does not exist on type 'HTMLInputElement'. Try changing the 'lib' compiler option to include 'dom'.
|
|
({} as any as EventTarget & HTMLInputElement).textContent
|
|
~~~~~~~~~~~
|
|
!!! error TS2812: Property 'textContent' does not exist on type 'EventTarget & HTMLInputElement'. Try changing the 'lib' compiler option to include 'dom'.
|
|
|
|
interface HTMLElementFake {}
|
|
interface Node {
|
|
actuallyNotTheSame: number;
|
|
};
|
|
|
|
({} as any as HTMLElementFake).textContent;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'textContent' does not exist on type 'HTMLElementFake'.
|
|
({} as any as Node).textContent;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'textContent' does not exist on type 'Node'.
|
|
|