use /* */ for line comments in less/stylus
This commit is contained in:
parent
40ec2c000f
commit
6110cbee68
|
@ -102,6 +102,7 @@
|
||||||
const m = this.doc.mode;
|
const m = this.doc.mode;
|
||||||
if (force || (m.helperType ? m.helperType !== pp : m.name !== name)) {
|
if (force || (m.helperType ? m.helperType !== pp : m.name !== name)) {
|
||||||
this.setOption('mode', name);
|
this.setOption('mode', name);
|
||||||
|
this.doc.mode.lineComment = ''; // stylelint chokes on line comments a lot
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** Superfast GC-friendly check that runs until the first non-space line */
|
/** Superfast GC-friendly check that runs until the first non-space line */
|
||||||
|
|
|
@ -159,10 +159,8 @@
|
||||||
}
|
}
|
||||||
const {rule} = m;
|
const {rule} = m;
|
||||||
const msg = m.text.replace(/^Unexpected\s+/, '').replace(` (${rule})`, '');
|
const msg = m.text.replace(/^Unexpected\s+/, '').replace(` (${rule})`, '');
|
||||||
if (slashCommentAllowed && (
|
if (slashCommentAllowed && msg.includes('"//"') ||
|
||||||
rule === 'no-invalid-double-slash-comments' ||
|
isLess && /^unknown at-rule "@[-\w]+:"/.test(msg) /* LESS variables */) {
|
||||||
rule === 'property-no-unknown' && msg.includes('"//"')
|
|
||||||
) || isLess && /^unknown at-rule "@[-\w]+:"/.test(msg) /* LESS variables */) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
res.push({
|
res.push({
|
||||||
|
|
Loading…
Reference in New Issue
Block a user