From 6110cbee6815d799764f20fe63f571b5cf56dae1 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 28 Aug 2022 22:47:58 +0300 Subject: [PATCH] use /* */ for line comments in less/stylus --- edit/codemirror-default.js | 1 + edit/editor-worker.js | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index 72d50720..4420c3c1 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -102,6 +102,7 @@ const m = this.doc.mode; if (force || (m.helperType ? m.helperType !== pp : m.name !== 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 */ diff --git a/edit/editor-worker.js b/edit/editor-worker.js index d78be935..aee5b22b 100644 --- a/edit/editor-worker.js +++ b/edit/editor-worker.js @@ -159,10 +159,8 @@ } const {rule} = m; const msg = m.text.replace(/^Unexpected\s+/, '').replace(` (${rule})`, ''); - if (slashCommentAllowed && ( - rule === 'no-invalid-double-slash-comments' || - rule === 'property-no-unknown' && msg.includes('"//"') - ) || isLess && /^unknown at-rule "@[-\w]+:"/.test(msg) /* LESS variables */) { + if (slashCommentAllowed && msg.includes('"//"') || + isLess && /^unknown at-rule "@[-\w]+:"/.test(msg) /* LESS variables */) { continue; } res.push({