Fix: reference error

This commit is contained in:
eight 2017-09-13 16:53:21 +08:00
parent 279c7d05a7
commit 31464bb499
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
'use strict';
CodeMirror.registerHelper('lint', 'csslint', code =>
CSSLint.verify(code, deepCopy(linterConfig.getCurrent('csslint')))
window.CSSLint && CSSLint.verify(code, deepCopy(linterConfig.getCurrent('csslint')))
.messages.map(message => ({
from: CodeMirror.Pos(message.line - 1, message.col - 1),
to: CodeMirror.Pos(message.line - 1, message.col),
@ -13,7 +13,7 @@ CodeMirror.registerHelper('lint', 'csslint', code =>
);
CodeMirror.registerHelper('lint', 'stylelint', code =>
stylelint.lint({
window.stylelint && stylelint.lint({
code,
config: deepCopy(linterConfig.getCurrent('stylelint')),
}).then(({results}) => {

View File

@ -3,7 +3,7 @@
/* global loadScript require CSSLint stylelint */
'use strict';
loadLinterAssets();
onDOMready().then(loadLinterAssets);
// eslint-disable-next-line no-var
var linterConfig = {