Skip to content
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

ensure_import_from falsy positively matches import { A as B } #206

Open
sergeysova opened this issue Jun 6, 2024 · 1 comment
Open

ensure_import_from falsy positively matches import { A as B } #206

sergeysova opened this issue Jun 6, 2024 · 1 comment

Comments

@sergeysova
Copy link

Pattern:

`$forward({ from: $a, to: $b })` => `sample({ clock: $a, target: $b })` where {
        $forward <: `forward`,
        $forward <: ensure_import_from(`"effector"`),
    }

Code:

import { forward as old } from 'effector'
forward({
  from: someHappened,
  to: anotherEvent,
})

Output:

import { forward as old, forward } from 'effector'
sample({ clock: someHappened, target: anotherEvent })

Problem:
It matches forward but sematically it is undefined.

https://app.grit.io/studio?key=7mt4vdorxWbnDIFasJTda

@morgante
Copy link
Contributor

morgante commented Jun 6, 2024

To be clear, it appears this is not matching the existing forward alias. If it did, the output this:

import { forward as old } from 'effector'
sample({ clock: someHappened, target: anotherEvent })
``

What do you expect the output to be in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants