Skip to content
Permalink
Browse files

New: Make `Severity` mandatory

  • Loading branch information
molant authored and sarvaje committed Nov 13, 2019
1 parent 12774e8 commit 43a3daa4b77072e220646573bdd3efc41b93b8d9
Showing with 3 additions and 3 deletions.
  1. +2 −2 packages/hint/src/lib/hint-context.ts
  2. +1 −1 packages/hint/tests/lib/hint-context.ts
@@ -33,7 +33,7 @@ export type ReportOptions = {
*/
location?: ProblemLocation | null;
/** The `Severity` to report the issue as. */
severity?: Severity;
severity: Severity;
/** Indicate the language of the codeSnippet. */
codeLanguage?: CodeLanguage;
};
@@ -123,7 +123,7 @@ export class HintContext<E extends Events = Events> {
}

/** Reports a problem with the resource. */
public report(resource: string, message: string, options: ReportOptions = {}) {
public report(resource: string, message: string, options: ReportOptions) {
const { codeSnippet, element, severity = Severity.warning } = options;
let sourceCode: string | null = null;
let position = options.location || null;
@@ -50,7 +50,7 @@ test(`hintContext should be a proxy for several engine's methods`, (t) => {

methods.forEach((method) => {
try {
context[method]();
context[method]('', '', {});
} catch (e) {
t.fail(`HintContext.${method}() doesn't exist`);
}

0 comments on commit 43a3daa

Please sign in to comment.
You can’t perform that action at this time.