From d8c9bc83793e490a6fc3d08992b1aa349a867618 Mon Sep 17 00:00:00 2001 From: eight Date: Sat, 1 Sep 2018 15:51:56 +0800 Subject: [PATCH] Fix: shouldn't delete rule.init --- edit/editor-worker-body.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/edit/editor-worker-body.js b/edit/editor-worker-body.js index 630b065a..bcca2d05 100644 --- a/edit/editor-worker-body.js +++ b/edit/editor-worker-body.js @@ -27,8 +27,13 @@ createAPI({ function getCsslintRules() { loadScript(['/vendor-overwrites/csslint/csslint.js']); return CSSLint.getRules().map(rule => { - delete rule.init; - return rule; + const output = {}; + for (const [key, value] of Object.entries(rule)) { + if (typeof value !== 'function') { + output[key] = value; + } + } + return output; }); }