2

I believe I have the correct setup, but am struggling to get tsc to compile.

My repo branch is https://github.com/inosion/sample-atom-typescript-package/tree/add_react

I have the latest version(s) of typescript - but am not sure what I am doing wrong - node_modules/@types/prop-types/index.d.ts(12,46): error TS1005: ';' expected. etc

    ✔ ~/projects/internal/github.com/inosion/sample-atom-typescript-package [master|✚ 3] 
    18:34 $ grep dependencies -A 10 package.json 
      "dependencies": {
        "typescript": "2.3",
        "@types/atom":"*",
        "@types/react":"*",
        "@types/react-native":"*"
      }
    }
    ✔ ~/projects/internal/github.com/inosion/sample-atom-typescript-package [master|✚ 3] 
    18:34 $ tsc --version
    Version 2.7.2
    ✔ ~/projects/internal/github.com/inosion/sample-atom-typescript-package [master|✚ 3] 
    18:34 $ apm clean
    ✔ ~/projects/internal/github.com/inosion/sample-atom-typescript-package [master|✚ 3] 
    18:34 $ tsc --project .
    node_modules/@types/prop-types/index.d.ts(12,46): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(12,75): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(12,99): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(14,54): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(14,78): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(14,81): error TS1109: Expression expected.
    node_modules/@types/prop-types/index.d.ts(14,97): error TS1109: Expression expected.
    node_modules/@types/prop-types/index.d.ts(14,122): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(14,130): error TS1128: Declaration or statement expected.
    node_modules/@types/prop-types/index.d.ts(14,138): error TS1005: ',' expected.
    node_modules/@types/prop-types/index.d.ts(27,48): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(27,49): error TS1109: Expression expected.
    node_modules/@types/prop-types/index.d.ts(27,50): error TS1109: Expression expected.
    node_modules/@types/prop-types/index.d.ts(27,68): error TS1005: '(' expected.
    node_modules/@types/prop-types/index.d.ts(27,69): error TS1005: ')' expected.
    node_modules/@types/prop-types/index.d.ts(29,30): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(29,54): error TS1005: ';' expected.
    node_modules/@types/prop-types/index.d.ts(29,57): error TS1109: Expression expected.
    node_modules/@types/react/index.d.ts(2293,27): error TS1005: ';' expected.
    node_modules/@types/react/index.d.ts(2294,14): error TS1005: ':' expected.
    node_modules/@types/react/index.d.ts(2294,28): error TS1005: ';' expected.
    node_modules/@types/react/index.d.ts(2295,9): error TS1109: Expression expected.
    node_modules/@types/react/index.d.ts(2296,9): error TS1005: '(' expected.
    node_modules/@types/react/index.d.ts(2297,9): error TS1005: '(' expected.
    node_modules/@types/react/index.d.ts(2298,5): error TS1005: '(' expected.
    node_modules/@types/react/index.d.ts(2298,12): error TS1005: ')' expected.
    node_modules/@types/react/index.d.ts(2310,49): error TS1005: ';' expected.
    node_modules/@types/react/index.d.ts(2310,76): error TS1005: ';' expected.
    node_modules/@types/react/index.d.ts(2310,99): error TS1005: ';' expected.
    node_modules/@types/react/index.d.ts(2311,13): error TS1128: Declaration or statement expected.
    node_modules/@types/react/index.d.ts(2312,13): error TS1005: '(' expected.
    node_modules/@types/react/index.d.ts(2312,17): error TS1005: ',' expected.
    node_modules/@types/react/index.d.ts(2312,44): error TS1005: ',' expected.
    node_modules/@types/react/index.d.ts(2312,45): error TS1005: ':' expected.
    node_modules/@types/react/index.d.ts(2314,17): error TS1005: '(' expected.
    node_modules/@types/react/index.d.ts(2314,21): error TS1005: ',' expected.
    node_modules/@types/react/index.d.ts(2314,51): error TS1005: ',' expected.
    node_modules/@types/react/index.d.ts(2314,52): error TS1005: ':' expected.
    node_modules/@types/react/index.d.ts(2316,21): error TS1005: '(' expected.
    node_modules/@types/react/index.d.ts(2316,24): error TS1005: ')' expected.

1 Answer 1

1

The first error you are getting is on a line with a conditional type (which was introduced in typescript 2.8) so this suggests you don't have the latest version (3.0 at the time of writing)

If you look at your output you will also clearly see:

18:34 $ tsc --version
Version 2.7.2

So the version being used is 2.7 which does not support the features used in the definitions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.