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

Fix a couple of no-cycle bugs #2083

Merged
merged 2 commits into from May 18, 2021
Merged

Fix a couple of no-cycle bugs #2083

merged 2 commits into from May 18, 2021

Commits on May 17, 2021

  1. [Fix] no-cycle: ignore imports where imported file only imports typ…

    …es of importing file
    
    This fixes this situation:
    
    `a.ts`:
    ```ts
    import { foo } from './b'
    ```
    
    `b.ts`:
    ```ts
    import type { Bar } from './a'
    ```
    
    Previously, `no-cycle` would have incorrectly reported a dependency cycle for the import in `a.ts`,
    even though `b.ts` is only importing types from `a.ts`.
    cherryblossom000 authored and ljharb committed May 17, 2021
    Copy the full SHA
    30bba6a View commit details
    Browse the repository at this point in the history
  2. [Fix] no-cycle: fix false negative when file imports a type after i…

    …mporting a value in Flow
    
    This fixes this situation:
    
    `a.js`:
    ```js
    import { foo } from './b'
    ```
    
    `b.js`:
    ```js
    // @flow
    import { bar, type Baz } from './a'
    ```
    
    Previously, `no-cycle` would have not reported a dependency cycle for the import in `a.js`, even
    though `b.js` is importing `bar`, which is not a type import, from `a.js`. This commit fixes that.
    cherryblossom000 authored and ljharb committed May 17, 2021
    Copy the full SHA
    72b9c3d View commit details
    Browse the repository at this point in the history