Assign stylelint to global, not lint

This commit is contained in:
Rob Garrison 2017-08-25 14:09:48 -05:00
parent 5b2cd77035
commit cbe6decb03

View File

@ -71,14 +71,14 @@
CodeMirror.registerHelper('lint', 'stylelint', text => { CodeMirror.registerHelper('lint', 'stylelint', text => {
const found = []; const found = [];
window.stylelint = require('stylelint').lint; window.stylelint = require('stylelint');
if (window.stylelint) { if (window.stylelint) {
return BG.chromeLocal.getValue('editorStylelintRules').then((rules = stylelintDefaultConfig.rules) => { return BG.chromeLocal.getValue('editorStylelintRules').then((rules = stylelintDefaultConfig.rules) => {
// stylelintDefaultConfig stored in stylelint-config.js & loaded by edit/lint.js // stylelintDefaultConfig stored in stylelint-config.js & loaded by edit/lint.js
if (Object.keys(rules).length === 0) { if (Object.keys(rules).length === 0) {
rules = stylelintDefaultConfig.rules; rules = stylelintDefaultConfig.rules;
} }
return stylelint({ return stylelint.lint({
code: text, code: text,
config: { config: {
syntax: stylelintDefaultConfig.syntax, syntax: stylelintDefaultConfig.syntax,