ember-eslint-parser 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/parser/transforms.js +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-eslint-parser",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@glimmer/syntax": "^0.95.0",
|
|
24
24
|
"@typescript-eslint/tsconfig-utils": "^8.57.1",
|
|
25
25
|
"content-tag": "^4.1.1",
|
|
26
|
-
"ember-estree": "^0.6.
|
|
26
|
+
"ember-estree": "^0.6.10",
|
|
27
27
|
"eslint-scope": "^9.1.2",
|
|
28
28
|
"html-tags": "^5.1.0",
|
|
29
29
|
"mathml-tag-names": "^4.0.0",
|
package/src/parser/transforms.js
CHANGED
|
@@ -278,6 +278,11 @@ export const replaceRange = function replaceRange(s, start, end, substitute) {
|
|
|
278
278
|
return s.slice(0, start) + substitute + s.slice(end);
|
|
279
279
|
};
|
|
280
280
|
|
|
281
|
+
function maskTemplateContentForLint(content) {
|
|
282
|
+
// Preserve line endings and UTF-16 length, but remove template syntax from the JS placeholder.
|
|
283
|
+
return content.replace(/[^\r\n]/g, ' ');
|
|
284
|
+
}
|
|
285
|
+
|
|
281
286
|
const processor = new Preprocessor();
|
|
282
287
|
|
|
283
288
|
class EmberParserError extends Error {
|
|
@@ -332,7 +337,7 @@ export function transformForLint(code, fileName) {
|
|
|
332
337
|
// Build placeholder JS inline (same format as ember-estree's toPlaceholderJS)
|
|
333
338
|
let jsCode = code;
|
|
334
339
|
for (const tplInfo of [...result].reverse()) {
|
|
335
|
-
const content = tplInfo.contents
|
|
340
|
+
const content = maskTemplateContentForLint(tplInfo.contents);
|
|
336
341
|
const start = tplInfo.range.startUtf16Codepoint;
|
|
337
342
|
const end = tplInfo.range.endUtf16Codepoint;
|
|
338
343
|
const tplLength = end - start;
|