From d2cba96e10ca39bb7954a2c3081710c5fed84c4b Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 26 Dec 2017 23:39:52 +0300 Subject: [PATCH] refactor CSSLint * reduce linting delay * parse mozformat in worker * allow empty functions in 'filter:' property https://drafts.fxtf.org/filter-effects/#supported-filter-functions * support comma-separated list in :lang() * strip vendor prefix in isLiteral() --- .eslintignore | 1 + .eslintrc | 4 +- edit.html | 4 +- edit/edit.js | 25 +- edit/lint.js | 24 +- edit/source-editor.js | 6 +- edit/util.js | 23 + js/moz-parser.js | 254 +- js/prefs.js | 12 +- js/usercss.js | 18 +- vendor-overwrites/csslint/csslint-loader.js | 35 + vendor-overwrites/csslint/csslint-worker.js | 11145 ------------------ vendor-overwrites/csslint/csslint.js | 1723 +++ vendor-overwrites/csslint/parserlib.js | 5963 ++++++++++ 14 files changed, 7908 insertions(+), 11329 deletions(-) create mode 100644 vendor-overwrites/csslint/csslint-loader.js delete mode 100644 vendor-overwrites/csslint/csslint-worker.js create mode 100644 vendor-overwrites/csslint/csslint.js create mode 100644 vendor-overwrites/csslint/parserlib.js diff --git a/.eslintignore b/.eslintignore index f1fc323f..8e747f5b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ vendor/ vendor-overwrites/* !vendor-overwrites/colorpicker +!vendor-overwrites/csslint diff --git a/.eslintrc b/.eslintrc index cc8956c0..159a4f12 100644 --- a/.eslintrc +++ b/.eslintrc @@ -239,13 +239,13 @@ rules: object-curly-spacing: [2, never] object-shorthand: [0] one-var-declaration-per-line: [1] - one-var: [0] + one-var: [2, {initialized: never}] operator-assignment: [2, always] operator-linebreak: [2, after, overrides: {"?": ignore, ":": ignore, "&&": ignore, "||": ignore}] padded-blocks: [0] prefer-numeric-literals: [2] prefer-rest-params: [0] - prefer-const: [1, {destructuring: any, ignoreReadBeforeAssign: true}] + prefer-const: [1, {destructuring: all, ignoreReadBeforeAssign: true}] quote-props: [0] quotes: [1, single, avoid-escape] radix: [2, as-needed] diff --git a/edit.html b/edit.html index 19375978..07f99b89 100644 --- a/edit.html +++ b/edit.html @@ -5,6 +5,7 @@ +