File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 3636 "ignoreRequire": true,
3737 "lang": "en_US",
3838 "skipWords": [
39- "tsconfig"
39+ "tsconfig",
40+ "jsconfig"
4041 ],
4142 // Check if word contains numbers
4243 "skipIfMatch": [
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "baseUrl" : " ." ,
4+ "paths" : {
5+ "@foo/*" : [" src/foo/*" ],
6+ "@bar/*" : [" src/bar/*" ]
7+ }
8+ }
9+ }
Original file line number Diff line number Diff line change @@ -24,9 +24,18 @@ function findAlias(
2424 filePath : string ,
2525 ignoredPaths : string [ ] = [ ] ,
2626) {
27- if ( fs . existsSync ( path . join ( baseDir , 'tsconfig.json' ) ) ) {
27+ const isTsconfigExists = fs . existsSync ( path . join ( baseDir , 'tsconfig.json' ) ) ;
28+ const isJsconfigExists = fs . existsSync ( path . join ( baseDir , 'jsconfig.json' ) ) ;
29+
30+ const configFile = isTsconfigExists
31+ ? 'tsconfig.json'
32+ : isJsconfigExists
33+ ? 'jsconfig.json'
34+ : null ;
35+
36+ if ( configFile ) {
2837 const tsconfig = JSON . parse (
29- fs . readFileSync ( path . join ( baseDir , 'tsconfig.json' ) ) . toString ( 'utf8' ) ,
38+ fs . readFileSync ( path . join ( baseDir , configFile ) ) . toString ( 'utf8' ) ,
3039 ) ;
3140
3241 const paths : Record < string , string [ ] > = tsconfig ?. compilerOptions ?. paths ?? { } ;
You can’t perform that action at this time.
0 commit comments