File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/cdk/schematics/update-tool/utils Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ import {FileSystemHost} from './virtual-host';
12
12
import { dirname } from 'path' ;
13
13
import { formatDiagnostics } from './diagnostics' ;
14
14
15
+ /** Code of the error raised by TypeScript when a tsconfig doesn't match any files. */
16
+ const NO_INPUTS_ERROR_CODE = 18003 ;
17
+
15
18
/** Class capturing a tsconfig parse error. */
16
19
export class TsconfigParseError extends Error { }
17
20
@@ -45,8 +48,12 @@ export function parseTsconfigFile(
45
48
{ } ,
46
49
) ;
47
50
48
- if ( parsed . errors . length ) {
49
- throw new TsconfigParseError ( formatDiagnostics ( parsed . errors , fileSystem ) ) ;
51
+ // Skip the "No inputs found..." error since we don't want to interrupt the migration if a
52
+ // tsconfig doesn't match a file. This will result in an empty `Program` which is still valid.
53
+ const errors = parsed . errors . filter ( diag => diag . code !== NO_INPUTS_ERROR_CODE ) ;
54
+
55
+ if ( errors . length ) {
56
+ throw new TsconfigParseError ( formatDiagnostics ( errors , fileSystem ) ) ;
50
57
}
51
58
52
59
return parsed ;
You can’t perform that action at this time.
0 commit comments