From a5a8d97767f7ed419f1647a0b698247f8f4e119b Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 26 Aug 2021 20:49:39 +0300 Subject: [PATCH] csslint: fix bugs in 'box-model' and 'ids' --- js/csslint/csslint.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/csslint/csslint.js b/js/csslint/csslint.js index 43c7df6a..80a36867 100644 --- a/js/csslint/csslint.js +++ b/js/csslint/csslint.js @@ -513,7 +513,7 @@ CSSLint.addRule['box-model'] = [{ if (!properties[size]) continue; for (const prop of sizeProps[size]) { if (prop !== 'padding' || !properties[prop]) continue; - const {value: {parts}, line, col} = properties[prop].value; + const {value: {parts}, line, col} = properties[prop]; if (parts.length !== 2 || Number(parts[0].value) !== 0) { reporter.report( `Using ${size} with ${prop} can sometimes make elements larger than you expect.`, @@ -1071,8 +1071,8 @@ CSSLint.addRule['ids'] = [{ const cnt = sel.parts.reduce((sum = 0, {type, modifiers}) => type === parser.SELECTOR_PART_TYPE - ? modifiers.reduce(sum, mod => sum + (mod.type === 'id')) - : sum); + ? modifiers.reduce((sum, mod) => sum + (mod.type === 'id'), 0) + : sum, 0); if (cnt) { reporter.report(`Id in selector${cnt > 1 ? '!'.repeat(cnt) : '.'}`, sel, rule); }