Skip to content

Commit

Permalink
feat: add --ignorets flag to allow building despite TS errors, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KiaraGrouwstra committed Nov 24, 2016
1 parent 0821afd commit da21bff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/dev-server/serve-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface ServeConfig {
useServerLogs: boolean;
notifyOnConsoleLog: boolean;
useProxy: boolean;
ignoreTsErrors: boolean;
}
export const LOGGER_DIR = '__ion-dev-server';
export const IONIC_LAB_URL = '/ionic-lab';
7 changes: 6 additions & 1 deletion src/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export function serve(context?: BuildContext) {
notificationPort: getNotificationPort(context),
useServerLogs: useServerLogs(context),
useProxy: useProxy(context),
notifyOnConsoleLog: sendClientConsoleLogs(context)
notifyOnConsoleLog: sendClientConsoleLogs(context),
ignoreTsErrors: getIgnoreTsErrors(context)
};

createNotificationServer(config);
Expand Down Expand Up @@ -130,3 +131,7 @@ function useProxy(context: BuildContext) {
function sendClientConsoleLogs(context: BuildContext) {
return hasConfigValue(context, '--consolelogs', '-c', 'ionic_consolelogs', false);
}

function getIgnoreTsErrors(context: BuildContext) {
return hasConfigValue(context, '--ignorets', '-i', 'ionic_ignore_ts_errors', false);
}
6 changes: 3 additions & 3 deletions src/transpile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function transpileWorker(context: BuildContext, workerConfig: TranspileWo

const diagnostics = runTypeScriptDiagnostics(context, tsDiagnostics);

if (diagnostics.length) {
if (diagnostics.length && !context.ignoreTsErrors) {
// darn, we've got some things wrong, transpile failed :(
printDiagnostics(context, DiagnosticsType.TypeScript, diagnostics, true, true);

Expand Down Expand Up @@ -175,7 +175,7 @@ function transpileUpdateWorker(event: string, filePath: string, context: BuildCo

const diagnostics = runTypeScriptDiagnostics(context, transpileOutput.diagnostics);

if (diagnostics.length) {
if (diagnostics.length && !context.ignoreTsErrors) {
printDiagnostics(context, DiagnosticsType.TypeScript, diagnostics, false, true);

// darn, we've got some errors with this transpiling :(
Expand Down Expand Up @@ -328,7 +328,7 @@ export function getTsConfig(context: BuildContext, tsConfigPath?: string): TsCon

const diagnostics = runTypeScriptDiagnostics(context, parsedConfig.errors);

if (diagnostics.length) {
if (diagnostics.length && !context.ignoreTsErrors) {
printDiagnostics(context, DiagnosticsType.TypeScript, diagnostics, true, true);
throw new BuildError();
}
Expand Down

0 comments on commit da21bff

Please sign in to comment.