@@ -12,7 +12,7 @@ type CompilerOptions = import("typescript").CompilerOptions
1212 */
1313
1414export const extractTwoSlashComplierOptions = ( ts : TS ) => {
15- const optMap = new Map < string , any > ( )
15+ let optMap = new Map < string , any > ( )
1616
1717 // @ts -ignore - optionDeclarations is not public API
1818 for ( const opt of ts . optionDeclarations ) {
@@ -26,10 +26,15 @@ export const extractTwoSlashComplierOptions = (ts: TS) => {
2626 codeLines . forEach ( line => {
2727 let match
2828 if ( ( match = booleanConfigRegexp . exec ( line ) ) ) {
29- options [ match [ 1 ] ] = true
30- setOption ( match [ 1 ] , "true" , options , optMap )
29+ if ( optMap . has ( match [ 1 ] . toLowerCase ( ) ) ) {
30+ options [ match [ 1 ] ] = true
31+ setOption ( match [ 1 ] , "true" , options , optMap )
32+ }
3133 } else if ( ( match = valuedConfigRegexp . exec ( line ) ) ) {
32- setOption ( match [ 1 ] , match [ 2 ] , options , optMap )
34+ console . log ( match )
35+ if ( optMap . has ( match [ 1 ] . toLowerCase ( ) ) ) {
36+ setOption ( match [ 1 ] , match [ 2 ] , options , optMap )
37+ }
3338 }
3439 } )
3540 return options
0 commit comments