deepCopy linterConfig to avoid rule normalization by stylelint
This commit is contained in:
parent
79c6f3e578
commit
22824d9ad5
|
@ -2,7 +2,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
CodeMirror.registerHelper('lint', 'csslint', code =>
|
CodeMirror.registerHelper('lint', 'csslint', code =>
|
||||||
CSSLint.verify(code, linterConfig.getCurrent('csslint'))
|
CSSLint.verify(code, deepCopy(linterConfig.getCurrent('csslint')))
|
||||||
.messages.map(message => ({
|
.messages.map(message => ({
|
||||||
from: CodeMirror.Pos(message.line - 1, message.col - 1),
|
from: CodeMirror.Pos(message.line - 1, message.col - 1),
|
||||||
to: CodeMirror.Pos(message.line - 1, message.col),
|
to: CodeMirror.Pos(message.line - 1, message.col),
|
||||||
|
@ -14,7 +14,7 @@ CodeMirror.registerHelper('lint', 'csslint', code =>
|
||||||
CodeMirror.registerHelper('lint', 'stylelint', code =>
|
CodeMirror.registerHelper('lint', 'stylelint', code =>
|
||||||
stylelint.lint({
|
stylelint.lint({
|
||||||
code,
|
code,
|
||||||
config: linterConfig.getCurrent('stylelint'),
|
config: deepCopy(linterConfig.getCurrent('stylelint')),
|
||||||
}).then(({results}) => {
|
}).then(({results}) => {
|
||||||
if (!results[0]) {
|
if (!results[0]) {
|
||||||
return [];
|
return [];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user