Fix issue when CSSLint isn't loaded
This commit is contained in:
parent
988af5f1b8
commit
e2228964d4
|
@ -203,8 +203,6 @@ function toggleLintReport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLintHelp() {
|
function showLintHelp() {
|
||||||
const CSSLintRules = CSSLint.getRules();
|
|
||||||
const findCSSLintRule = id => CSSLintRules.find(rule => rule.id === id);
|
|
||||||
const makeLink = (url, txt) => `<a target="_blank" href="${url}">${txt}</a>`;
|
const makeLink = (url, txt) => `<a target="_blank" href="${url}">${txt}</a>`;
|
||||||
const linter = prefs.get('editor.linter');
|
const linter = prefs.get('editor.linter');
|
||||||
const url = linter === 'stylelint'
|
const url = linter === 'stylelint'
|
||||||
|
@ -216,6 +214,8 @@ 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 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 => {
|
||||||
const rule = findCSSLintRule(ruleID);
|
const rule = findCSSLintRule(ruleID);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user