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 import from CJS lib #241

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curly-scissors-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-import-resolver-typescript': patch
---

Fix CJS import to make it compatible with ESM projects
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"funding": "https://opencollective.com/unts/projects/eslint-import-resolver-ts",
"license": "ISC",
"packageManager": "pnpm@8.0.0",
"packageManager": "pnpm@8.7.6",
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
Expand Down
102 changes: 21 additions & 81 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import debug from 'debug'
import type { FileSystem, ResolveOptions, Resolver } from 'enhanced-resolve'
import enhancedResolve from 'enhanced-resolve'
import { hashObject } from 'eslint-module-utils/hash.js'
import { sync as globSync } from 'fast-glob'
import fg from 'fast-glob'
import { createPathsMatcher, getTsconfig } from 'get-tsconfig'
import type { TsConfigResult } from 'get-tsconfig'
import isCore from 'is-core-module'
import isGlob from 'is-glob'

const { globSync } = fg

const IMPORTER_NAME = 'eslint-import-resolver-typescript'

const log = debug(IMPORTER_NAME)
Expand Down
Loading