Fix: logic to get correct linter
This commit is contained in:
parent
ed3ec6215c
commit
fe4cc7b59f
|
@ -175,10 +175,12 @@ var stylelint = (() => { // eslint-disable-line no-var
|
||||||
let preparing;
|
let preparing;
|
||||||
|
|
||||||
linter.register((text, options, cm) => {
|
linter.register((text, options, cm) => {
|
||||||
if (prefs.get('editor.linter') !== 'stylelint' && cm.getOption('mode') !== 'stylus') {
|
if (
|
||||||
|
!prefs.get('editor.linter') ||
|
||||||
|
cm.getOption('mode') === 'css' && prefs.get('editor.linter') !== 'stylelint'
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
debugger;
|
|
||||||
return prepareConfig()
|
return prepareConfig()
|
||||||
.then(() => editorWorker.stylelint(text, config))
|
.then(() => editorWorker.stylelint(text, config))
|
||||||
.then(({results}) => {
|
.then(({results}) => {
|
||||||
|
|
|
@ -109,7 +109,7 @@ function createSourceEditor(style) {
|
||||||
|
|
||||||
function getCurrentLinter() {
|
function getCurrentLinter() {
|
||||||
const name = prefs.get('editor.linter');
|
const name = prefs.get('editor.linter');
|
||||||
if (cm.getOption('mode') === 'stylus' && name === 'csslint') {
|
if (cm.getOption('mode') !== 'css' && name === 'csslint') {
|
||||||
return 'stylelint';
|
return 'stylelint';
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user