ember-eslint-parser 0.3.8 → 0.4.0
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 +8 -8
- package/src/parser/transforms.js +3 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-eslint-parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@babel/core": "^7.23.6",
|
|
22
|
-
"@typescript-eslint/parser": "^
|
|
23
|
-
"@typescript-eslint/visitor-keys": "^
|
|
22
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
23
|
+
"@typescript-eslint/visitor-keys": "^7.1.0",
|
|
24
24
|
"concurrently": "^8.2.2",
|
|
25
25
|
"eslint": "^8.0.1",
|
|
26
26
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"fs-extra": "^11.2.0",
|
|
34
34
|
"prettier": "^3.2.5",
|
|
35
35
|
"publint": "^0.2.6",
|
|
36
|
-
"release-plan": "^0.
|
|
36
|
+
"release-plan": "^0.8.0",
|
|
37
37
|
"typescript": "^5.3.3",
|
|
38
38
|
"vite": "^5.0.12",
|
|
39
39
|
"vitest": "^1.2.2"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@babel/eslint-parser": "7.23.10",
|
|
43
43
|
"@glimmer/syntax": "^0.88.0",
|
|
44
|
-
"@typescript-eslint/scope-manager": "^
|
|
44
|
+
"@typescript-eslint/scope-manager": "^7.1.0",
|
|
45
45
|
"content-tag": "^1.2.2",
|
|
46
46
|
"eslint-scope": "^7.2.2",
|
|
47
47
|
"html-tags": "^3.3.1"
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@babel/core": "^7.23.6",
|
|
54
|
-
"@typescript-eslint/parser": "^
|
|
54
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
55
55
|
"typescript": "^5.3.3"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"test": "vitest run",
|
|
59
59
|
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
|
|
60
|
-
"lint:js": "eslint .",
|
|
60
|
+
"lint:js": "eslint . --max-warnings=0",
|
|
61
61
|
"lint:package": "pnpm publint",
|
|
62
62
|
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
|
|
63
|
-
"lint:js:fix": "eslint . --fix"
|
|
63
|
+
"lint:js:fix": "eslint . --fix --max-warnings=0"
|
|
64
64
|
}
|
|
65
65
|
}
|
package/src/parser/transforms.js
CHANGED
|
@@ -566,20 +566,16 @@ module.exports.transformForLint = function transformForLint(code) {
|
|
|
566
566
|
*/
|
|
567
567
|
const result = processor.parse(code);
|
|
568
568
|
for (const tplInfo of result.reverse()) {
|
|
569
|
-
const
|
|
570
|
-
(prev, curr) => (prev + (curr.codePointAt(0) === '`') ? 1 : 0),
|
|
571
|
-
0
|
|
572
|
-
);
|
|
573
|
-
const content = tplInfo.contents.replace(/`/g, '\\`');
|
|
569
|
+
const content = tplInfo.contents.replace(/`/g, '\\`').replace(/\$/g, '\\$');
|
|
574
570
|
if (tplInfo.type === 'class-member') {
|
|
575
571
|
const tplLength = tplInfo.range.end - tplInfo.range.start;
|
|
576
|
-
const spaces = tplLength - byteLength(content) - 'static{`'.length - '`}'.length
|
|
572
|
+
const spaces = tplLength - byteLength(content) - 'static{`'.length - '`}'.length;
|
|
577
573
|
const total = content + ' '.repeat(spaces);
|
|
578
574
|
const replacementCode = `static{\`${total}\`}`;
|
|
579
575
|
jsCode = replaceRange(jsCode, tplInfo.range.start, tplInfo.range.end, replacementCode);
|
|
580
576
|
} else {
|
|
581
577
|
const tplLength = tplInfo.range.end - tplInfo.range.start;
|
|
582
|
-
const spaces = tplLength - byteLength(content) - '`'.length - '`'.length
|
|
578
|
+
const spaces = tplLength - byteLength(content) - '`'.length - '`'.length;
|
|
583
579
|
const total = content + ' '.repeat(spaces);
|
|
584
580
|
const replacementCode = `\`${total}\``;
|
|
585
581
|
jsCode = replaceRange(jsCode, tplInfo.range.start, tplInfo.range.end, replacementCode);
|