-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-unused-vars firing incorrectly on args inside template-tag #2118
no-unused-vars firing incorrectly on args inside template-tag #2118
Comments
Does |
Underscores don't seem to make any difference out-the-box. Calling it If I configure an eslint /*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/
const array = [];
<template>
{{#each array as |_item index|}}
{{index}}
{{/each}}
</template> ^^ this passes ✅ But this |
Oh, right. |
Same issue in both gjs and gts 😓 |
Isn't this correct behavior tho? |
This fails ❌ <template>
{{#each array as |item index|}}
{{index}}
{{/each}}
</template> This passes ✅ someFunction((item, index) => console.log(index)); Conceptually, they are the same, so the eslint result should be the same for both examples. Eslint docs say
|
Ah! Thanks for that clarification! I didn't know they differentiate with prior positionals! |
Given this snippet:
Eslint will fail with
In the same file, I can do
someFunction((item, index) => console.log(index));
in regular javascript with no errors about 'item' being unused.So it seems that the default '
args: after-used
' behaviour is not being applied properly inside template tags.The text was updated successfully, but these errors were encountered: