Skip to content

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

@sergeysova

Description

@sergeysova

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions