File: jsxCheckJsxNoTypeArgumentsAllowed.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (41 lines) | stat: -rw-r--r-- 2,057 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
35
36
37
38
39
40
41
tests/cases/conformance/jsx/file.jsx(1,18): error TS18042: 'Prop' is a type and cannot be imported in JavaScript files. Use 'import("./component").Prop' in a JSDoc type annotation.
tests/cases/conformance/jsx/file.jsx(4,9): error TS2657: JSX expressions must have one parent element.
tests/cases/conformance/jsx/file.jsx(4,16): error TS1003: Identifier expected.
tests/cases/conformance/jsx/file.jsx(4,17): error TS2693: 'Prop' only refers to a type, but is being used as a value here.
tests/cases/conformance/jsx/file.jsx(4,17): error TS17008: JSX element 'Prop' has no corresponding closing tag.
tests/cases/conformance/jsx/file.jsx(4,38): error TS1382: Unexpected token. Did you mean `{'>'}` or `>`?
tests/cases/conformance/jsx/file.jsx(5,1): error TS1005: '</' expected.


==== tests/cases/conformance/jsx/component.d.ts (0 errors) ====
    import * as React from "react";
    export declare class MyComp<P> extends React.Component<P, {}> {
        internalProp: P;
    }
    
    export interface Prop {
        a: number,
        b: string
    }
    
==== tests/cases/conformance/jsx/file.jsx (7 errors) ====
    import { MyComp, Prop } from "./component";
                     ~~~~
!!! error TS18042: 'Prop' is a type and cannot be imported in JavaScript files. Use 'import("./component").Prop' in a JSDoc type annotation.
    import * as React from "react";
    
    let x = <MyComp<Prop> a={10} b="hi" />; // error, no type arguments in js
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   ~
!!! error TS1003: Identifier expected.
                    ~~~~
!!! error TS2693: 'Prop' only refers to a type, but is being used as a value here.
                    ~~~~
!!! error TS17008: JSX element 'Prop' has no corresponding closing tag.
                                         ~
!!! error TS1382: Unexpected token. Did you mean `{'>'}` or `&gt;`?
    
    
!!! error TS2657: JSX expressions must have one parent element.
    
!!! error TS1005: '</' expected.