Created
July 29, 2019 03:36
-
-
Save wisetc/275b803bb3b5b9b28155a6b4f797d00d to your computer and use it in GitHub Desktop.
Basic typescript/javascript project configuration for react.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"allowJs": true, | |
"target": "es2015", | |
"baseUrl": "./src", | |
"outDir": "./build", | |
"jsx": "react", | |
"moduleResolution": "node", | |
"suppressImplicitAnyIndexErrors": true, | |
"allowSyntheticDefaultImports": true | |
}, | |
"include": [ | |
"./src/**/*" | |
] | |
} |
suppressImplicitAnyIndexErrors
: to check property out of object error
moduleResolution
: to support node modules import syntax.
add checkJs: true
or // @ts-check
to support js type check.
to support Promise.finally, target should be es2018
, or esnext
.:smile:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
allowSyntheticDefaultImports
: useimport React
instead ofimport * as React