+
Skip to content

import $what from $where does not match all types of import statements #663

@Sjlver

Description

@Sjlver

Versions
grit 0.1.1

Steps to reproduce

GritQL seems to not match the last import statements in the typescript file below.

Or maybe it does, but does not report it? It confusingly reports seven matches but prints only six. Either way, everything can't be right.

// Named import
import { a } from "foo";

// Default import
import b from "foo";

// Namespace import
import * as c from "foo";

// Type import
import type { d } from "foo";

// Multiple named imports
import { e, f } from "foo";

// Multiple named imports with type import
import type { g, h } from "foo";
import { i, type j } from "foo";
grit apply '`import $what from $where`' tests/specs/ts/import_patterns.ts
tests/specs/ts/import_patterns.ts
     2  import { a } from "foo";
     5  import b from "foo";
     8  import * as c from "foo";
    11  import type { d } from "foo";
    14  import { e, f } from "foo";
    17  import type { g, h } from "foo";

Processed 1 files and found 7 matches

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

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载