-
Notifications
You must be signed in to change notification settings - Fork 31
Support typescript #99
Comments
Have you added the typescript extensions in your babel config? Here's my config for example, which works fine with @babel/preset-typescript babel...
[
'babel-plugin-module-resolver',
{
cwd: 'packagejson',
root: ['./src'],
alias: {
lib: './src/lib'
},
extensions: ['.js', '.ts']
}
] eslint"settings": {
"import/resolver": {
"node": {
"paths": ["./src"],
},
"babel-module": {}
}
} |
I did the other way around, by adding the extensions to te eslintrc config. |
Bumped into this as well, the secret ingredient is adding the Babel itself doesn't complain when leaving out The most elegant option is in my opinion to thus add this to the ESLint configuration // .eslintrc.yml
settings:
import/resolver:
babel-module:
extensions:
- ".js"
- ".ts"
// Add other extensions if needed |
Sorry for unearthing a very old thread, but this was a life saver. Adding the extensions part fixed my unresolved import errors. |
How can I config it to support typescript? The docs doesn't mention anything about this. Thanks.
The text was updated successfully, but these errors were encountered: