From d0e30a6b5ac3982dbe6de9c52674c70d39c7bd3a Mon Sep 17 00:00:00 2001 From: Patrick Hulce Date: Fri, 11 Oct 2019 18:07:17 -0500 Subject: [PATCH] misc: warn on use of unrecognized audit options --- lighthouse-core/audits/errors-in-console.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/audits/errors-in-console.js b/lighthouse-core/audits/errors-in-console.js index 341204bfff79..27349f93a3be 100644 --- a/lighthouse-core/audits/errors-in-console.js +++ b/lighthouse-core/audits/errors-in-console.js @@ -10,6 +10,7 @@ * This is done by collecting Chrome console log messages and filtering out the non-error ones. */ +const log = require('lighthouse-logger'); const Audit = require('./audit.js'); const i18n = require('../lib/i18n/i18n.js'); @@ -57,7 +58,9 @@ class ErrorLogs extends Audit { * @return {Array} */ static filterAccordingToOptions(items, options) { - const {ignoredPatterns} = options; + const {ignoredPatterns, ...restOfOptions} = options; + const otherOptionKeys = Object.keys(restOfOptions); + if (otherOptionKeys.length) log.warn(this.meta.id, 'Unrecognized options', otherOptionKeys); if (!ignoredPatterns) return items; return items.filter(({description}) => {