use /* */ for line comments in less/stylus

This commit is contained in:
tophf 2022-08-28 22:47:58 +03:00
parent 40ec2c000f
commit 6110cbee68
2 changed files with 3 additions and 4 deletions

View File

@ -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 */

View File

@ -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({