Skip to content

Conversation

@patricklx
Copy link
Contributor

@patricklx patricklx commented Aug 22, 2023

resolves #1897

}
const currentScope = findParentScope(scopeManager, nodePath);
if (!scope) {
return { scope: findParentScope(scopeManager, nodePath) };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed to fix the current scope, as the references should be added in the scope where the references are and not where the variable definition is

}
}

if ('blockParams' in node) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed to move this down. this creates the scope for elementnodes and mustache blocks.
it should do this after creating the references, as otherwise the current scope would be the element or mustache block itself

"ember/use-ember-data-rfc-395-imports": "error"
}
"ember/use-ember-data-rfc-395-imports": "error",
"ember/template-no-let-reference": "error"
Copy link
Member

@bmish bmish Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The set of recommended rules should only be updated during a major release. If you like, we can enable it as recommended at that time.

@patricklx patricklx mentioned this pull request Oct 31, 2023
@patricklx patricklx force-pushed the template-no-let-reference branch 7 times, most recently from ecd1507 to d7e52d8 Compare November 2, 2023 10:51
@NullVoxPopuli
Copy link
Contributor

needs rebase it looks like

@patricklx patricklx force-pushed the template-no-let-reference branch from d7e52d8 to 5ff6570 Compare November 2, 2023 15:18
}

export default <template>{{foo}}</template>;
````
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra tick.

"ember/require-tagless-components": "error",
"ember/require-valid-css-selector-in-test-helpers": "error",
"ember/routes-segments-snake-case": "error",
"ember/template-no-let-reference": "error",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a separate PR to enable any rules as recommended? It's more clear what's going on then and will be better for the resulting changelog. Normally, we never create rules at the same time as enabling them as recommended.

@patricklx patricklx force-pushed the template-no-let-reference branch from 5ff6570 to b5ab4aa Compare November 2, 2023 15:24
@patricklx patricklx force-pushed the template-no-let-reference branch from b5ab4aa to 2d10fe0 Compare November 2, 2023 15:27
@bmish bmish changed the title add template-no-let-reference rule Add new rule template-no-let-reference Nov 2, 2023
@bmish bmish merged commit 372f6b8 into ember-cli:master Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New rule to lint against referencing let variables in <template>

3 participants