ember-eslint-parser 0.4.2 → 0.5.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 +3 -3
- package/src/parser/transforms.js +17 -1
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-eslint-parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git@github.com:
|
|
8
|
+
"url": "git@github.com:ember-tooling/ember-eslint-parser.git"
|
|
9
9
|
},
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"author": "",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/eslint-parser": "7.23.10",
|
|
44
44
|
"@glimmer/syntax": "^0.92.0",
|
|
45
|
-
"content-tag": "^
|
|
45
|
+
"content-tag": "^2.0.1",
|
|
46
46
|
"eslint-scope": "^7.2.2",
|
|
47
47
|
"html-tags": "^3.3.1"
|
|
48
48
|
},
|
package/src/parser/transforms.js
CHANGED
|
@@ -512,13 +512,29 @@ module.exports.convertAst = function convertAst(result, preprocessedResult, visi
|
|
|
512
512
|
result.scopeManager.declaredVariables || result.scopeManager.__declaredVariables;
|
|
513
513
|
const vars = [];
|
|
514
514
|
declaredVariables.set(node, vars);
|
|
515
|
+
const virtualJSParentNode = {
|
|
516
|
+
type: 'FunctionDeclaration',
|
|
517
|
+
params: node.params,
|
|
518
|
+
range: node.range,
|
|
519
|
+
loc: node.loc,
|
|
520
|
+
parent: path.parent,
|
|
521
|
+
};
|
|
515
522
|
for (const [i, b] of node.params.entries()) {
|
|
516
523
|
const v = new Variable(b.name, scope);
|
|
517
524
|
v.identifiers.push(b);
|
|
518
|
-
v.defs.push(new Definition('Parameter', b, node, node, i, 'Block Param'));
|
|
519
525
|
scope.variables.push(v);
|
|
520
526
|
scope.set.set(b.name, v);
|
|
521
527
|
vars.push(v);
|
|
528
|
+
|
|
529
|
+
const virtualJSNode = {
|
|
530
|
+
type: 'Identifier',
|
|
531
|
+
name: b.name,
|
|
532
|
+
range: b.range,
|
|
533
|
+
loc: b.loc,
|
|
534
|
+
parent: virtualJSParentNode,
|
|
535
|
+
};
|
|
536
|
+
v.defs.push(new Definition('Parameter', virtualJSNode, node, node, i, 'Block Param'));
|
|
537
|
+
v.defs.push(new Definition('Parameter', b, node, node, i, 'Block Param'));
|
|
522
538
|
}
|
|
523
539
|
}
|
|
524
540
|
return null;
|