Assign stylelint
to global, not lint
This commit is contained in:
parent
5b2cd77035
commit
cbe6decb03
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user