From e96f0808ed276e2e454a27a4ec5ec29cbdcaab5a Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sat, 26 Aug 2017 10:42:38 -0500 Subject: [PATCH] Rename CSSLint rule config file & variable --- edit/{csslint-ruleset.js => csslint-config.js} | 2 +- edit/lint.js | 10 +++++----- vendor-overwrites/codemirror/addon/lint/css-lint.js | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) rename edit/{csslint-ruleset.js => csslint-config.js} (96%) diff --git a/edit/csslint-ruleset.js b/edit/csslint-config.js similarity index 96% rename from edit/csslint-ruleset.js rename to edit/csslint-config.js index c285fb4e..34be3368 100644 --- a/edit/csslint-ruleset.js +++ b/edit/csslint-config.js @@ -4,7 +4,7 @@ * CSSLint Ruleset values * 0 = disabled; 1 = warning; 2 = error */ -window.csslintDefaultRuleset = { +window.csslintDefaultRuleConfig = { // Default warnings 'display-property-grouping': 1, 'duplicate-properties': 1, diff --git a/edit/lint.js b/edit/lint.js index a6d90e50..9a9f2ddd 100644 --- a/edit/lint.js +++ b/edit/lint.js @@ -1,6 +1,6 @@ /* global CodeMirror messageBox */ /* global editors makeSectionVisible showCodeMirrorPopup showHelp */ -/* global stylelintDefaultConfig csslintDefaultRuleset onDOMscripted injectCSS require */ +/* global stylelintDefaultConfig csslintDefaultRuleConfig onDOMscripted injectCSS require */ 'use strict'; function initLint() { @@ -28,8 +28,8 @@ function setStylelintRules(rules) { } function setCSSLintRules(ruleset) { - if (Object.keys(ruleset || []).length === 0 && typeof csslintDefaultRuleset !== 'undefined') { - ruleset = Object.assign({}, csslintDefaultRuleset); + if (Object.keys(ruleset || []).length === 0 && typeof csslintDefaultRuleConfig !== 'undefined') { + ruleset = Object.assign({}, csslintDefaultRuleConfig); } BG.chromeSync.setValue('editorCSSLintRules', ruleset); return ruleset; @@ -317,7 +317,7 @@ function setupLinterSettingsEvents(popup) { rules = stylelintDefaultConfig.rules; } else { setCSSLintRules(); - rules = csslintDefaultRuleset; + rules = csslintDefaultRuleConfig; } popup.codebox.setValue(stringifyRules(rules)); updateLinter(linter); @@ -412,7 +412,7 @@ function loadSelectedLinter(name) { } if (name === 'csslint' && !window.CSSLint) { scripts.push( - 'edit/csslint-ruleset.js', + 'edit/csslint-config.js', 'vendor-overwrites/csslint/csslint-worker.js' ); } else if (name === 'stylelint' && !window.stylelint) { diff --git a/vendor-overwrites/codemirror/addon/lint/css-lint.js b/vendor-overwrites/codemirror/addon/lint/css-lint.js index 371387c3..f3aed094 100644 --- a/vendor-overwrites/codemirror/addon/lint/css-lint.js +++ b/vendor-overwrites/codemirror/addon/lint/css-lint.js @@ -4,7 +4,7 @@ // Depends on csslint.js from https://github.com/stubbornella/csslint /* global CodeMirror require define */ -/* global CSSLint stylelint stylelintDefaultConfig csslintDefaultRuleset */ +/* global CSSLint stylelint stylelintDefaultConfig csslintDefaultRuleConfig */ 'use strict'; (mod => { @@ -25,10 +25,10 @@ return found; } /* STYLUS: hack start (part 1) */ - return BG.chromeSync.getValue('editorCSSLintRules').then((ruleset = csslintDefaultRuleset) => { - // csslintDefaultRuleset stored in csslint-ruleset.js & loaded by edit/lint.js + return BG.chromeSync.getValue('editorCSSLintRules').then((ruleset = csslintDefaultRuleConfig) => { + // csslintDefaultRuleConfig stored in csslint-config.js & loaded by edit/lint.js if (Object.keys(ruleset).length === 0) { - ruleset = Object.assign({}, csslintDefaultRuleset); + ruleset = Object.assign({}, csslintDefaultRuleConfig); } const results = CSSLint.verify(text, ruleset); const messages = results.messages;