Skip to content

fix: multiline imports#16

Merged
qwerqy merged 1 commit intomainfrom
fix-for-multiline-imports
Jan 29, 2025
Merged

fix: multiline imports#16
qwerqy merged 1 commit intomainfrom
fix-for-multiline-imports

Conversation

@qwerqy
Copy link
Owner

@qwerqy qwerqy commented Jan 29, 2025

Fixes support for multiline imports. Previously, it was only working for one-liner imports

// importtest.ts
const Foo = "foo"
const Bar = "bar"
// otherfile.ts
import {
Foo,
Bar
} from "./importtest.ts"

When you run this, it will show no result

node dist/index.js scan -d test -i ./importme.ts -ext .tsx,.ts

Result:

No files found with "./importme.ts" imports across directory /Users/aminroslan/Projects/Qwerqy/scan-imports/test.

After fix, this is the result:

Found 1 files with "./importme.ts" imports across directory /Users/aminroslan/Projects/Qwerqy/scan-imports/test:
{
  "default": {},
  "named": {
    "Foo": 1,
    "Bar": 1
  }
}

Fix for issue #15

@qwerqy
Copy link
Owner Author

qwerqy commented Jan 29, 2025

Test is flaky due to console.log output is a wildcard to expect. Overriding this and fix test later

@qwerqy qwerqy merged commit c51366d into main Jan 29, 2025
1 check failed
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

Successfully merging this pull request may close these issues.

1 participant