Comments (7)
Oh, right.
Does it make a difference of its a gts or gjs file?
from eslint-plugin-ember.
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
unused positional arguments that occur before the last used argument will not be checked, but all named arguments and all positional arguments after the last used argument will be checked.
from eslint-plugin-ember.
Ah! Thanks for that clarification! I didn't know they differentiate with prior positionals!
from eslint-plugin-ember.
Does _item
also get reported as unused?
from eslint-plugin-ember.
Underscores don't seem to make any difference out-the-box. Calling it _item
, or _
doesn't make any difference
If I configure an eslint argsIgnorePattern
, then underscored variables can be ignored:
/*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/
const array = [];
<template>
{{#each array as |_item index|}}
{{index}}
{{/each}}
</template>
^^ this passes ✅
But this argsIgnorePattern
is not default eslint behaviour, so I imagine most projects rely on the default 'args: after-used'' behaviour.
from eslint-plugin-ember.
Same issue in both gjs and gts 😓
from eslint-plugin-ember.
Isn't this correct behavior tho?
(Am i missing something? 😅)
from eslint-plugin-ember.
Related Issues (20)
- ESLint couldn't find the config "plugin:ember/gts-recommended" to extend from HOT 4
- false positives for `no-unused-vars` in `gjs` files, when using `<Component as |something|>` HOT 3
- gjs/gts Incorrect token mapping after handlebars HOT 1
- Support "Type aware" linting for gts files HOT 13
- "service" import not treated the same as "inject as service" HOT 1
- no-unused-expressions HOT 4
- Plan v13 Release HOT 4
- new "flat" configs contain invalid parser key HOT 19
- `@typescript-eslint` breaks after update to `eslint-plugin-ember` v12 HOT 19
- ember/template-no-let-reference HOT 4
- ember/no-runloop HOT 4
- New rule: prevent assignment of existing properties on a service (important for tests)
- @typescript-eslint/eslint-recommended not applicable to `*.gts` files HOT 1
- Should we provide a config that disables some rules from `@typescript-eslint/eslint-plugin`? HOT 11
- Lint against shadowed keywords
- eslint v9 support
- `no-pause-test` rule doesn't work for test files with `.gts` or `.gjs` extension HOT 5
- `ember/no-runloop` brings false positive error with function name `hasOwnProperty` HOT 4
- New rule proposal: no-tracked-declare HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-ember.