File: jsxNamespacePrefixIntrinsics.errors.txt

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (34 lines) | stat: -rw-r--r-- 1,988 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx(15,18): error TS2339: Property 'element' does not exist on type 'JSX.IntrinsicElements'.
tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx(16,30): error TS2322: Type '{ attribute: string; }' is not assignable to type '{ "ns:attribute": string; }'.
  Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'?
tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx(17,30): error TS2322: Type '{ "ns:invalid": string; }' is not assignable to type '{ "ns:attribute": string; }'.
  Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'.


==== tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx (3 errors) ====
    declare namespace JSX {
      interface IntrinsicElements {
        "ns:element": {
          "ns:attribute": string;
        },
        "ns:NamespacedUpcaseAlsoIntrinsic": any,
        "NS:NamespacedUpcaseAlsoIntrinsic": any
      }
    }
    
    const valid = <ns:element ns:attribute="yep" />;
    const validUpcase1 = <ns:NamespacedUpcaseAlsoIntrinsic />;
    const validUpcase2 = <NS:NamespacedUpcaseAlsoIntrinsic />;
    
    const invalid1 = <element />;
                     ~~~~~~~~~~~
!!! error TS2339: Property 'element' does not exist on type 'JSX.IntrinsicElements'.
    const invalid2 = <ns:element attribute="nope" />;
                                 ~~~~~~~~~
!!! error TS2322: Type '{ attribute: string; }' is not assignable to type '{ "ns:attribute": string; }'.
!!! error TS2322:   Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'?
    const invalid3 = <ns:element ns:invalid="nope" />;
                                 ~~~~~~~~~~
!!! error TS2322: Type '{ "ns:invalid": string; }' is not assignable to type '{ "ns:attribute": string; }'.
!!! error TS2322:   Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'.