File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 } */
142module . 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 } ,
You can’t perform that action at this time.
0 commit comments