Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
strategy:
matrix:
node:
- 16
- 18
- 20
- 22
Expand All @@ -24,10 +23,9 @@ jobs:
- macos-latest
fail-fast: false
runs-on: ${{ matrix.os }}
env:
YARN_IGNORE_NODE: 1
steps:
- uses: actions/checkout@v4
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
Expand All @@ -41,9 +39,7 @@ jobs:
- name: Build and Typecov
run: yarn run-s build typecov
env:
EFF_NO_LINK_RULES: true
PARSER_NO_WATCH: true

- name: Lint and Test
if: ${{ matrix.node != 16}}
run: yarn run-s lint test
1 change: 0 additions & 1 deletion .lintstagedrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .nano-staged.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@1stg/nano-staged/tsc'
2 changes: 1 addition & 1 deletion .size-limit.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"path": "./lib/index.js",
"limit": "3.1kB"
"limit": "1.5kB"
}
]
935 changes: 0 additions & 935 deletions .yarn/releases/yarn-4.7.0.cjs

This file was deleted.

948 changes: 948 additions & 0 deletions .yarn/releases/yarn-4.9.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ plugins:
path: .yarn/plugins/plugin-prepare-lifecycle.cjs
spec: 'https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js'

yarnPath: .yarn/releases/yarn-4.7.0.cjs
yarnPath: .yarn/releases/yarn-4.9.1.cjs
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
],
"funding": "https://opencollective.com/eslint-import-resolver-typescript",
"license": "ISC",
"packageManager": "yarn@4.7.0",
"packageManager": "yarn@4.9.1",
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
"main": "lib/index.cjs",
"types": "lib/index.d.ts",
"module": "lib/index.js",
"exports": {
".": {
Expand All @@ -28,7 +29,6 @@
},
"es2020": "lib/index.es2020.mjs",
"fesm2020": "lib/index.es2020.mjs",
"types": "lib/index.d.ts",
"files": [
"lib",
"shim.d.ts",
Expand Down Expand Up @@ -86,38 +86,38 @@
"get-tsconfig": "^4.10.0",
"is-bun-module": "^2.0.0",
"stable-hash": "^0.0.5",
"tinyglobby": "^0.2.12",
"unrs-resolver": "^1.3.2"
"tinyglobby": "^0.2.13",
"unrs-resolver": "^1.6.2"
},
"devDependencies": {
"@1stg/common-config": "^11.1.0",
"@1stg/common-config": "^13.0.1",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.28.1",
"@changesets/cli": "^2.29.2",
"@commitlint/cli": "^19.8.0",
"@mozilla/glean": "^5.0.3",
"@pkgr/rollup": "^6.0.1",
"@mozilla/glean": "^5.0.4",
"@pkgr/rollup": "^6.0.3",
"@total-typescript/ts-reset": "^0.6.1",
"@types/debug": "^4.1.12",
"@types/node": "^22.13.13",
"@types/node": "^22.14.1",
"@types/pnpapi": "^0.0.5",
"@types/unist": "^3.0.3",
"clean-pkg-json": "^1.2.1",
"clean-pkg-json": "^1.3.0",
"cross-env": "^7.0.3",
"dummy.js": "link:dummy.js",
"eslint": "^9.23.0",
"eslint": "^9.25.0",
"eslint-import-resolver-typescript": "link:.",
"eslint-plugin-import-x": "^4.9.3",
"lint-staged": "^15.5.0",
"eslint-plugin-import-x": "^4.10.6",
"nano-staged": "^0.8.0",
"npm-run-all2": "^7.0.2",
"prettier": "^3.5.3",
"react": "^19.0.0",
"react": "^19.1.0",
"simple-git-hooks": "^2.12.1",
"size-limit": "^11.2.0",
"size-limit-preset-node-lib": "^0.3.0",
"type-coverage": "^2.29.7",
"type-fest": "^4.38.0",
"typescript": "~5.8.2",
"yarn-berry-deduplicate": "^6.1.1"
"type-fest": "^4.40.0",
"typescript": "~5.8.3",
"yarn-berry-deduplicate": "^6.1.3"
},
"resolutions": {
"eslint-import-resolver-typescript": "link:.",
Expand Down
35 changes: 20 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const defaultConditionNames = [
]

/**
* `.mts`, `.cts`, `.d.mts`, `.d.cts`, `.mjs`, `.cjs` are not included because `.cjs` and `.mjs` must be used explicitly
* `.mts`, `.cts`, `.d.mts`, `.d.cts`, `.mjs`, `.cjs` are not included because
* `.cjs` and `.mjs` must be used explicitly
*/
export const defaultExtensions = [
'.ts',
Expand Down Expand Up @@ -107,8 +108,8 @@ let resolverCachedOptions: InternalResolverOptions
let cachedResolver: ResolverFactory | undefined

/**
* @param source the module to resolve; i.e './some-module'
* @param file the importing file's full path; i.e. '/usr/local/bin/file.js'
* @param source The module to resolve; i.e './some-module'
* @param file The importing file's full path; i.e. '/usr/local/bin/file.js'
* @param options
*/
// eslint-disable-next-line sonarjs/cognitive-complexity
Expand Down Expand Up @@ -157,9 +158,7 @@ export function resolve(
}
}

/**
* {@link https://github.com/webpack/enhanced-resolve/blob/38e9fd9acb79643a70e7bcd0d85dabc600ea321f/lib/PnpPlugin.js#L81-L83}
*/
/** {@link https://github.com/webpack/enhanced-resolve/blob/38e9fd9acb79643a70e7bcd0d85dabc600ea321f/lib/PnpPlugin.js#L81-L83} */
if (process.versions.pnp && source === 'pnpapi') {
return {
found: true,
Expand Down Expand Up @@ -273,10 +272,11 @@ const isModule = (modulePath?: string): modulePath is string =>
!!modulePath && isFile(path.resolve(modulePath, 'package.json'))

/**
* @param {string} source the module to resolve; i.e './some-module'
* @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js'
* @param {string[]} extensions the extensions to try
* @param {boolean} retry should retry on failed to resolve
* @param {string} source The module to resolve; i.e './some-module'
* @param {string} file The importing file's full path; i.e.
* '/usr/local/bin/file.js'
* @param {string[]} extensions The extensions to try
* @param {boolean} retry Should retry on failed to resolve
* @returns The mapped path of the module or undefined
*/
// eslint-disable-next-line sonarjs/cognitive-complexity
Expand Down Expand Up @@ -328,9 +328,12 @@ function getMappedPaths(
.filter(mappedPath => {
try {
const stat = fs.statSync(mappedPath, { throwIfNoEntry: false })
if (stat === undefined) return false
if (stat.isFile()) return true

if (stat === undefined) {
return false
}
if (stat.isFile()) {
return true
}
// Maybe this is a module dir?
if (stat.isDirectory()) {
return isModule(mappedPath)
Expand Down Expand Up @@ -500,7 +503,8 @@ function initMappers(options: InternalResolverOptions) {
}

/**
* For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`.
* For a scoped package, we must look in `@types/foo__bar` instead of
* `@types/@foo/bar`.
*/
function mangleScopedPackage(moduleName: string) {
if (moduleName.startsWith('@')) {
Expand Down Expand Up @@ -543,7 +547,8 @@ function toNativePathSeparator(p: string) {
}

/**
* Counts how many characters in strings `a` and `b` are exactly the same and in the same position.
* Counts how many characters in strings `a` and `b` are exactly the same and in
* the same position.
*
* @param {string} a First string
* @param {string} b Second string
Expand Down
Loading
Loading