ember-cli / eslint-plugin-ember

An ESLint plugin that provides set of rules for Ember applications based on commonly known good practices.
MIT License
259 stars 201 forks source link

False positive `no-undef` for template-imports and contextual components #1747

Closed simonihmig closed 10 months ago

simonihmig commented 1 year ago

This is failing linting with form and field "locals" (they are not local to the outer template scope, so not supposed to be provided by JS scope, which ESLint thinks here) falsely violating no-undef:

<template>
  <HeadlessForm @data={{data}} as |form|>
    <form.field @name="firstName" as |field|>
      <field.label>First Name</field.label>
      <field.input data-test-first-name />
    </form.field>
    <form.field @name="lastName" as |field|>
      <field.label>Last Name</field.label>
      <field.input data-test-last-name />
    </form.field>
  </HeadlessForm>
</template>

I think I have identified the root cause in @glimmer/syntax, keeping this for tracking. /cc @NullVoxPopuli

simonihmig commented 1 year ago

My attempt to fix this upstream: https://github.com/glimmerjs/glimmer-vm/pull/1406

bmish commented 1 year ago

Note that this change was reverted: