Clean up lint globals

This commit is contained in:
Rob Garrison 2017-08-26 09:49:14 -05:00
parent 95ff72b722
commit 2df6b8bca0

View File

@ -1,4 +1,5 @@
/* global CodeMirror CSSLint editors makeSectionVisible showHelp showCodeMirrorPopup messageBox */ /* global CodeMirror messageBox */
/* global editors makeSectionVisible showCodeMirrorPopup showHelp */
/* global stylelintDefaultConfig csslintDefaultRuleset onDOMscripted injectCSS require */ /* global stylelintDefaultConfig csslintDefaultRuleset onDOMscripted injectCSS require */
'use strict'; 'use strict';
@ -214,7 +215,7 @@ function showLintHelp() {
let list = '<ul class="rules">'; let list = '<ul class="rules">';
let header = ''; let header = '';
if (linter === 'csslint') { if (linter === 'csslint') {
const CSSLintRules = CSSLint.getRules(); const CSSLintRules = window.CSSLint.getRules();
const findCSSLintRule = id => CSSLintRules.find(rule => rule.id === id); const findCSSLintRule = id => CSSLintRules.find(rule => rule.id === id);
header = t('issuesHelp', makeLink('https://github.com/CSSLint/csslint/wiki/Rules-by-ID', 'CSSLint')); header = t('issuesHelp', makeLink('https://github.com/CSSLint/csslint/wiki/Rules-by-ID', 'CSSLint'));
template = ruleID => { template = ruleID => {
@ -269,7 +270,7 @@ function checkRules(linter, rules) {
const invalid = []; const invalid = [];
const linterRules = linter === 'stylelint' const linterRules = linter === 'stylelint'
? Object.keys(window.stylelint.rules) ? Object.keys(window.stylelint.rules)
: CSSLint.getRules().map(rule => rule.id); : window.CSSLint.getRules().map(rule => rule.id);
Object.keys(rules).forEach(rule => { Object.keys(rules).forEach(rule => {
if (!linterRules.includes(rule)) { if (!linterRules.includes(rule)) {
invalid.push(rule); invalid.push(rule);