patternfly-react-demo-app icon indicating copy to clipboard operation
patternfly-react-demo-app copied to clipboard

Why .js rather than .ts or .tsx? Getting errors in VS Code

Open murphye opened this issue 6 years ago • 4 comments

Getting multiple errors is VS Code saying:

[js] (insert error here) can only be used in a .ts file

Wouldn't it follow convention not to use .js file names?

murphye avatar Mar 28 '18 18:03 murphye

I'm getting those errors too. It seems like the app was started on the js version of create-react-app, but typescript was added later on

Mhbuur avatar Jun 21 '18 12:06 Mhbuur

There was a typescript version started in the branch here: https://github.com/patternfly/patternfly-react-demo-app/tree/typescript

I think we can add another in the near future. PF React Next will support .tsx.

ok to close this for now? If you'd like to contribute more typings to this project that's fine, otherwise we can focus on a tsx boiler in a new demo soon :)

priley86 avatar Jun 21 '18 13:06 priley86

Weirdly, I am getting [ts] related errors all over the place in another non-typescript project. Is that because of the file extension? hm.

mturley avatar Jun 21 '18 15:06 mturley

This might be due to the flow files being interpreted as TS by vscode, if that is your editor.

dmiller9911 avatar Jun 22 '18 17:06 dmiller9911