diff --git a/src/validate/html/validateEventHandler.ts b/src/validate/html/validateEventHandler.ts index 6f571806fe..9a22bdd6c8 100644 --- a/src/validate/html/validateEventHandler.ts +++ b/src/validate/html/validateEventHandler.ts @@ -34,7 +34,7 @@ export default function validateEventHandlerCallee( ) return; - const validCallees = ['this.*', 'event.*'].concat( + const validCallees = ['this.*', 'event.*', 'console.*'].concat( Array.from(validBuiltins), Array.from(validator.methods.keys()) ); diff --git a/test/validator/samples/method-nonexistent-helper/warnings.json b/test/validator/samples/method-nonexistent-helper/warnings.json index 02512426a1..d090c4df94 100644 --- a/test/validator/samples/method-nonexistent-helper/warnings.json +++ b/test/validator/samples/method-nonexistent-helper/warnings.json @@ -1,5 +1,5 @@ [{ - "message": "'foo' is an invalid callee (should be one of this.*, event.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?", + "message": "'foo' is an invalid callee (should be one of this.*, event.*, console.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?", "pos": 18, "loc": { "line": 1, diff --git a/test/validator/samples/method-nonexistent/warnings.json b/test/validator/samples/method-nonexistent/warnings.json index 8debbf8132..d8f4e0e0cf 100644 --- a/test/validator/samples/method-nonexistent/warnings.json +++ b/test/validator/samples/method-nonexistent/warnings.json @@ -1,5 +1,5 @@ [{ - "message": "'foo' is an invalid callee (should be one of this.*, event.*, set, fire, destroy or bar)", + "message": "'foo' is an invalid callee (should be one of this.*, event.*, console.*, set, fire, destroy or bar)", "pos": 18, "loc": { "line": 1, diff --git a/test/validator/samples/window-event-invalid/warnings.json b/test/validator/samples/window-event-invalid/warnings.json index 425c657cb1..20dc4c79fa 100644 --- a/test/validator/samples/window-event-invalid/warnings.json +++ b/test/validator/samples/window-event-invalid/warnings.json @@ -1,5 +1,5 @@ [{ - "message": "'resize' is an invalid callee (should be one of this.*, event.*, set, fire or destroy)", + "message": "'resize' is an invalid callee (should be one of this.*, event.*, console.*, set, fire or destroy)", "loc": { "line": 1, "column": 20