File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ export function validateOptions(options: CompilerOptions): ts.Diagnostic[] {
9999 diagnostics . push ( diagnosticFactories . unsupportedJsxEmit ( ) ) ;
100100 }
101101
102- // paths without baseUrl is now supported (TS 6.0+ resolves paths relative to tsconfig location)
102+ if ( options . paths && Object . keys ( options . paths ) . length > 0 && ! options . baseUrl && ! options . configFilePath ) {
103+ diagnostics . push ( diagnosticFactories . pathsWithoutBaseDirectory ( ) ) ;
104+ }
103105
104106 return diagnostics ;
105107}
Original file line number Diff line number Diff line change @@ -55,3 +55,8 @@ export const cannotBundleLibrary = createDiagnosticFactory(
5555) ;
5656
5757export const unsupportedJsxEmit = createDiagnosticFactory ( ( ) => 'JSX is only supported with "react" jsx option.' ) ;
58+
59+ export const pathsWithoutBaseDirectory = createDiagnosticFactory (
60+ ( ) =>
61+ "When using 'paths' without 'baseUrl', a tsconfig.json must be present so paths can be resolved relative to it."
62+ ) ;
You can’t perform that action at this time.
0 commit comments