Skip to content

Commit

Permalink
(fix) missing-custom-element-compile-options cannot be ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Aug 5, 2020
1 parent d48fa0f commit c8b1950
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,20 @@ function getCodeActionTitle(diagnostic: Diagnostic) {
return `(svelte) Disable ${diagnostic.code} for this line`;
}

/**
* Whether or not the given diagnostic can be ignored via a
* <!-- svelte-ignore <code> -->
*/
export function isIgnorableSvelteDiagnostic(diagnostic: Diagnostic) {
const { source, severity, code } = diagnostic;
return code && source === 'svelte' && severity !== DiagnosticSeverity.Error;
return (
code &&
!nonIgnorableWarnings.includes(<string>code) &&
source === 'svelte' &&
severity !== DiagnosticSeverity.Error
);
}
const nonIgnorableWarnings = ['missing-custom-element-compile-options'];

async function getSvelteIgnoreEdit(svelteDoc: SvelteDocument, ast: Ast, diagnostic: Diagnostic) {
const {
Expand Down

0 comments on commit c8b1950

Please sign in to comment.