Skip to content

Commit 805e6a5

Browse files
Merge pull request #2497 from johanrd/fix/2477
Post-merge review of #2477 (`template-no-link-to-positional-params`)
2 parents b691ce6 + 4104666 commit 805e6a5

1 file changed

Lines changed: 0 additions & 35 deletions

File tree

lib/rules/template-no-link-to-positional-params.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
/**
2-
* Helper function to check if a node is a LinkTo component
3-
* @param {Object} node - The AST node to check
4-
* @returns {boolean} - True if node is a LinkTo component
5-
*/
6-
function isLinkToComponent(node) {
7-
if (node.type === 'GlimmerElementNode') {
8-
return node.tag === 'LinkTo' || node.tag === 'link-to';
9-
}
10-
return false;
11-
}
12-
131
/** @type {import('eslint').Rule.RuleModule} */
142
module.exports = {
153
meta: {
@@ -49,29 +37,6 @@ module.exports = {
4937
}
5038

5139
return {
52-
GlimmerElementNode(node) {
53-
if (!isLinkToComponent(node)) {
54-
return;
55-
}
56-
57-
// Check if there are positional params (non-@ attributes without = sign, which are params)
58-
const hasPositionalParams = node.attributes.some(
59-
(attr) =>
60-
attr.type === 'GlimmerAttrNode' &&
61-
!attr.name.startsWith('@') &&
62-
attr.value &&
63-
attr.value.type !== 'GlimmerTextNode' &&
64-
!node.modifiers.some((mod) => mod.path.original === attr.name)
65-
);
66-
67-
if (hasPositionalParams) {
68-
context.report({
69-
node,
70-
messageId: 'noLinkToPositionalParams',
71-
});
72-
}
73-
},
74-
7540
GlimmerMustacheStatement(node) {
7641
checkForPositionalParams(node);
7742
},

0 commit comments

Comments
 (0)