-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't let typescript get confused #114
Comments
This might be wrong... but try the vscode instructions. I remember hearing typescript also reads that file. I'm happy to update the readme if there's a known working solution. |
I searched a bit and found 2 related resources https://github.com/niieani/typescript-vs-flowtype#mapping-dynamic-module-names https://www.typescriptlang.org/docs/handbook/module-resolution.html So I added in my tsconfig.json {
"compilerOptions": {
…
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
}
},
…
} And I could build without getting an error :') |
Is there any additional configuration for typescript? My project was expo javascript and the plugin was working fine with this configurations: Project structure: Myproject
- src/
AppRoot.js
- error/
ErrorBoundary.js
-all project code inside src
package.json
jsconfig.json jsconfig.json {
"compilerOptions": {
"baseUrl": "src",
"paths": {
"~/*": ["*"]
},
} babel.config.js plugins: [
['babel-plugin-root-import',
{
"rootPathSuffix": "src",
"rootPathPrefix": "~"
}
],
], Import use AppRoot.js import ErrorBoundary from '~/error/ErrorBoundary'; Then i converted to typescript, replaced jsconfig to tsconfig, and geting error to resolver when running the app Unable to resolve "../error/ErrorBoundary" from "src\AppRoot.tsx" Vscode typescript is working fine, it resolves the path in intellisense so i think im missing something in babel.config.js importing without slash it works import ErrorBoundary from '~error/ErrorBoundary'; in javascript it was working with slash ~/ in typescript its trying to lev one directory up ../ any ideia how to fix that? |
Can we add an equivalent to the flow setup for typescript ?
Being new to typescript, I'm not sure how this should be solved.
The text was updated successfully, but these errors were encountered: