Skip to content

Commit

Permalink
Fix CJS import to make it compatible with ESM projects (#241)
Browse files Browse the repository at this point in the history
Fix CJS import to make it compatible with ESM projects
  • Loading branch information
klippx authored Sep 22, 2023
1 parent 7b6bfc3 commit cf5d67f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 83 deletions.
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

0 comments on commit cf5d67f

Please sign in to comment.