Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Add support to ignore certain diagnostics (#46)
Browse files Browse the repository at this point in the history
Add support to ignore certain diagnostics
  • Loading branch information
alexdima committed Dec 17, 2019
2 parents c050127 + d5b5ce1 commit e91b33e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/languageFeatures.ts
Expand Up @@ -181,6 +181,7 @@ export class DiagnosticsAdapter extends Adapter {
}
const markers = diagnostics
.reduce((p, c) => c.concat(p), [])
.filter(d => (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(d.code) === -1)
.map(d => this._convertDiagnostics(resource, d));

monaco.editor.setModelMarkers(monaco.editor.getModel(resource), this._selector, markers);
Expand Down
1 change: 1 addition & 0 deletions src/monaco.d.ts
Expand Up @@ -129,6 +129,7 @@ declare module monaco.languages.typescript {
noSemanticValidation?: boolean;
noSyntaxValidation?: boolean;
noSuggestionDiagnostics?: boolean;
diagnosticCodesToIgnore?: number[];
}

export interface LanguageServiceDefaults {
Expand Down

0 comments on commit e91b33e

Please sign in to comment.