Skip to content

Commit deb5774

Browse files
committed
chore: hourcekeeping, bump all (dev) deps
1 parent c894d76 commit deb5774

File tree

34 files changed

+7881
-6986
lines changed

34 files changed

+7881
-6986
lines changed

.env.yarn

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NODE_OPTIONS="${NODE_OPTIONS} --no-warnings=ESLintRCWarning"

.eslintignore

-7
This file was deleted.

.eslintrc

-16
This file was deleted.

.github/workflows/ci.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,7 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v4
3131

32-
- name: Setup target Node.js to enable Corepack
33-
uses: actions/setup-node@v4
34-
with:
35-
node-version: ${{ matrix.node }}
36-
37-
- name: Enable Corepack
38-
run: corepack enable
39-
40-
- name: Setup Node.js ${{ matrix.node }} with cache
32+
- name: Setup Node.js ${{ matrix.node }}
4133
uses: actions/setup-node@v4
4234
with:
4335
node-version: ${{ matrix.node }}

.github/workflows/release.yml

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ jobs:
2121
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2222
fetch-depth: 0
2323

24-
- name: Enable Corepack
25-
run: corepack enable
26-
2724
- name: Setup Node.js LTS
2825
uses: actions/setup-node@v4
2926
with:

.github/workflows/size-limit.yml

-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23-
- name: Enable Corepack
24-
run: corepack enable
25-
2623
- name: Setup Node.js LTS
2724
uses: actions/setup-node@v4
2825
with:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
.type-coverage
33
.yarn/*
44
!.yarn/plugins
5+
!.yarn/releases
56
lib
67
node_modules
78
*.log
9+
.npmrc

.lintstagedrc.cjs

-1
This file was deleted.

.lintstagedrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@1stg/lint-staged/tsc'

.renovaterc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"extends": [
3-
"@1stg"
3+
"github>1stG/configs"
44
]
55
}

.size-limit.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
33
"path": "./lib/index.js",
4-
"limit": "3.2kB"
4+
"limit": "3.1kB"
55
}
66
]

.yarn/releases/yarn-4.7.0.cjs

+935
Large diffs are not rendered by default.

.yarnrc.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ nodeLinker: node-modules
55
plugins:
66
- checksum: 37b2361b1502b2054e6779788c0e9bdd6a90ce49852a8cad2feda79b0614ec94f06fb6e78951f5f95429c610d7934dd077caa47413a0227378a102c55161616d
77
path: .yarn/plugins/plugin-prepare-lifecycle.cjs
8-
spec: "https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js"
8+
spec: 'https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js'
9+
10+
yarnPath: .yarn/releases/yarn-4.7.0.cjs

eslint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@1stg/eslint-config'

package.json

+34-35
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"funding": "https://opencollective.com/unts/projects/eslint-import-resolver-ts",
1212
"license": "ISC",
13-
"packageManager": "yarn@4.0.2",
13+
"packageManager": "yarn@4.7.0",
1414
"engines": {
1515
"node": "^14.18.0 || >=16.0.0"
1616
},
@@ -45,25 +45,26 @@
4545
"build": "run-p 'build:*'",
4646
"build:r": "r -f cjs,es2020",
4747
"build:ts": "tsc -b",
48+
"eslint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint --cache",
4849
"lint": "run-p 'lint:*'",
49-
"lint:es": "eslint src --cache -f friendly",
50+
"lint:es": "cross-env ESLINT_USE_FLAT_CONFIG=true eslint src --cache",
5051
"lint:tsc": "tsc --noEmit",
5152
"prepare": "simple-git-hooks && yarn-berry-deduplicate || exit 0",
5253
"release": "changeset publish",
5354
"test": "run-p 'test:*'",
54-
"test:dotInclude": "eslint --ext ts,tsx tests/dotInclude --ignore-pattern \"!.dot\"",
55-
"test:dotPaths": "eslint --ext ts,tsx tests/dotPaths --ignore-pattern \"!.dot\"",
56-
"test:dotProject": "eslint --ext ts,tsx tests/dotProject --ignore-pattern \"!.dot\"",
57-
"test:importXResolverV3": "cross-env ESLINT_USE_FLAT_CONFIG=true eslint --config=tests/importXResolverV3/eslint.config.js tests/importXResolverV3",
58-
"test:multipleEslintrcs": "eslint --ext ts,tsx tests/multipleEslintrcs",
59-
"test:multipleTsconfigs": "eslint --ext ts,tsx tests/multipleTsconfigs",
60-
"test:nearestTsconfig": "eslint --ext ts,tsx tests/nearestTsconfig",
61-
"test:withJsExtension": "node tests/withJsExtension/test.js && eslint --ext ts,tsx tests/withJsExtension",
62-
"test:withJsconfig": "eslint --ext js tests/withJsconfig",
63-
"test:withPaths": "eslint --ext ts,tsx tests/withPaths",
64-
"test:withPathsAndNestedBaseUrl": "eslint --ext ts,tsx tests/withPathsAndNestedBaseUrl",
65-
"test:withQuerystring": "eslint --ext ts,tsx tests/withQuerystring",
66-
"test:withoutPaths": "eslint --ext ts,tsx tests/withoutPaths",
55+
"test:dotInclude": "yarn eslint --ext ts,tsx tests/dotInclude --ignore-pattern \"!.dot\"",
56+
"test:dotPaths": "yarn eslint --ext ts,tsx tests/dotPaths --ignore-pattern \"!.dot\"",
57+
"test:dotProject": "yarn eslint --ext ts,tsx tests/dotProject --ignore-pattern \"!.dot\"",
58+
"test:importXResolverV3": "eslint --cache --config=tests/importXResolverV3/eslint.config.cjs tests/importXResolverV3",
59+
"test:multipleEslintrcs": "yarn eslint --ext ts,tsx tests/multipleEslintrcs",
60+
"test:multipleTsconfigs": "yarn eslint --ext ts,tsx tests/multipleTsconfigs",
61+
"test:nearestTsconfig": "yarn eslint --ext ts,tsx tests/nearestTsconfig",
62+
"test:withJsExtension": "node tests/withJsExtension/test.js && yarn eslint --ext ts,tsx tests/withJsExtension",
63+
"test:withJsconfig": "yarn eslint --ext js tests/withJsconfig",
64+
"test:withPaths": "yarn eslint --ext ts,tsx tests/withPaths",
65+
"test:withPathsAndNestedBaseUrl": "yarn eslint --ext ts,tsx tests/withPathsAndNestedBaseUrl",
66+
"test:withQuerystring": "yarn eslint --ext ts,tsx tests/withQuerystring",
67+
"test:withoutPaths": "yarn eslint --ext ts,tsx tests/withoutPaths",
6768
"typecov": "type-coverage"
6869
},
6970
"peerDependencies": {
@@ -81,45 +82,43 @@
8182
},
8283
"dependencies": {
8384
"@nolyfill/is-core-module": "1.0.39",
84-
"debug": "^4.3.7",
85+
"debug": "^4.4.0",
8586
"get-tsconfig": "^4.10.0",
86-
"is-bun-module": "^1.0.2",
87+
"is-bun-module": "^1.3.0",
8788
"oxc-resolver": "^5.0.0",
8889
"stable-hash": "^0.0.5",
8990
"tinyglobby": "^0.2.12"
9091
},
9192
"devDependencies": {
92-
"@1stg/eslint-config": "7.0.1",
93-
"@1stg/lib-config": "^12.0.1",
93+
"@1stg/lib-config": "^13.0.1",
9494
"@changesets/changelog-github": "^0.5.1",
95-
"@changesets/cli": "^2.27.12",
96-
"@commitlint/cli": "^17.8.1",
97-
"@mozilla/glean": "^3.0.0",
98-
"@pkgr/rollup": "^4.1.3",
95+
"@changesets/cli": "^2.28.1",
96+
"@commitlint/cli": "^19.8.0",
97+
"@mozilla/glean": "^5.0.3",
98+
"@pkgr/rollup": "^6.0.0",
9999
"@types/debug": "^4.1.12",
100-
"@types/node": "^18.19.78",
101-
"@types/unist": "^2.0.11",
100+
"@types/node": "^22.13.10",
101+
"@types/unist": "^3.0.3",
102102
"cross-env": "^7.0.3",
103103
"dummy.js": "link:dummy.js",
104-
"eslint": "^8.57.1",
104+
"eslint": "^9.22.0",
105105
"eslint-import-resolver-typescript": "link:.",
106-
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
107106
"eslint-plugin-import-x": "^4.7.0",
108-
"lint-staged": "^13.3.0",
109-
"npm-run-all2": "^5.0.2",
110-
"prettier": "^2.8.8",
111-
"react": "^18.3.1",
107+
"lint-staged": "^15.5.0",
108+
"npm-run-all2": "^7.0.2",
109+
"prettier": "^3.5.3",
110+
"react": "^19.0.0",
112111
"simple-git-hooks": "^2.11.1",
113-
"size-limit": "^11.0.0",
112+
"size-limit": "^11.2.0",
114113
"size-limit-preset-node-lib": "^0.3.0",
115-
"type-coverage": "^2.27.0",
114+
"type-coverage": "^2.29.7",
116115
"type-fest": "^4.37.0",
117-
"typescript": "~5.1.0",
116+
"typescript": "~5.8.2",
118117
"yarn-berry-deduplicate": "^6.1.1"
119118
},
120119
"resolutions": {
121120
"eslint-import-resolver-typescript": "link:.",
122-
"prettier": "^2.8.8"
121+
"prettier": "^3.5.3"
123122
},
124123
"typeCoverage": {
125124
"atLeast": 100,

src/.eslintrc.cjs

-3
This file was deleted.

src/index.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ export function createTypeScriptImportResolver(
245245
/** Remove any trailing querystring from module id. */
246246
function removeQuerystring(id: string) {
247247
const querystringIndex = id.lastIndexOf('?')
248-
if (querystringIndex >= 0) {
248+
if (querystringIndex !== -1) {
249249
return id.slice(0, querystringIndex)
250250
}
251251
return id
252252
}
253253

254-
const isFile = (path?: string | undefined): path is string => {
254+
const isFile = (path?: string): path is string => {
255255
try {
256256
return !!(path && fs.statSync(path, { throwIfNoEntry: false })?.isFile())
257257
} catch {
@@ -260,7 +260,7 @@ const isFile = (path?: string | undefined): path is string => {
260260
}
261261
}
262262

263-
const isModule = (modulePath?: string | undefined): modulePath is string => {
263+
const isModule = (modulePath?: string): modulePath is string => {
264264
return !!modulePath && isFile(path.resolve(modulePath, 'package.json'))
265265
}
266266

@@ -315,7 +315,7 @@ function getMappedPaths(
315315
...originalExtensions.map(ext => `${item}/index${ext}`),
316316
]),
317317
)
318-
.flat(2)
318+
.flat(/* The depth is always 2 */ 2)
319319
.map(toNativePathSeparator)
320320
.filter(mappedPath => {
321321
try {
@@ -380,7 +380,6 @@ function getMappedPaths(
380380
return paths
381381
}
382382

383-
// eslint-disable-next-line sonarjs/cognitive-complexity
384383
function initMappers(options: InternalResolverOptions) {
385384
if (
386385
mappers.length > 0 &&
@@ -390,13 +389,13 @@ function initMappers(options: InternalResolverOptions) {
390389
return
391390
}
392391
prevCwd = process.cwd()
393-
394392
const configPaths = (
395393
typeof options.project === 'string'
396394
? [options.project]
397-
: Array.isArray(options.project)
398-
? options.project
399-
: [process.cwd()]
395+
: // eslint-disable-next-line sonarjs/no-nested-conditional
396+
Array.isArray(options.project)
397+
? options.project
398+
: [process.cwd()]
400399
) // 'tinyglobby' pattern must have POSIX separator
401400
.map(config => replacePathSeparator(config, path.sep, path.posix.sep))
402401

@@ -464,7 +463,7 @@ function initMappers(options: InternalResolverOptions) {
464463
tsconfigResult.config.files.length > 0
465464
? tsconfigResult.config.files.map(file =>
466465
path.normalize(
467-
path.resolve(path.dirname(tsconfigResult!.path), file),
466+
path.resolve(path.dirname(tsconfigResult.path), file),
468467
),
469468
)
470469
: []),
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
/**
2+
* @import {TSESLint} from '@typescript-eslint/utils'
23
* @param {string} project
4+
* @returns {TSESLint.ClassicConfig.Config}
35
*/
4-
module.exports = project => ({
5-
parser: '@typescript-eslint/parser',
6+
const base = project => ({
67
extends: [
78
'eslint:recommended',
89
'plugin:@typescript-eslint/eslint-recommended',
910
'plugin:@typescript-eslint/recommended',
10-
'plugin:import/errors',
11-
'plugin:import/typescript',
11+
'plugin:import-x/errors',
12+
'plugin:import-x/typescript',
1213
],
1314
settings: {
14-
'import/resolver': {
15+
'import-x/resolver': {
1516
typescript: {
1617
project,
1718
alwaysTryTypes: true,
1819
},
1920
},
2021
},
2122
rules: {
22-
'import/no-duplicates': 0,
23-
'import/no-unresolved': 2,
24-
'import/extensions': [
23+
'import-x/no-duplicates': 0,
24+
'import-x/no-unresolved': 2,
25+
'import-x/extensions': [
2526
2,
2627
'ignorePackages',
2728
{
@@ -38,8 +39,10 @@ module.exports = project => ({
3839
{
3940
files: '**/.*.cjs',
4041
rules: {
41-
'@typescript-eslint/no-var-requires': 'off',
42+
'@typescript-eslint/no-require-imports': 'off',
4243
},
4344
},
4445
],
4546
})
47+
48+
module.exports = base

tests/dotInclude/.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('../baseEslintConfig.cjs')(__dirname)
1+
module.exports = require('../base.eslintrc.cjs')(__dirname)

tests/dotPaths/.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('../baseEslintConfig.cjs')(__dirname)
1+
module.exports = require('../base.eslintrc.cjs')(__dirname)

tests/dotProject/.eslintrc.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const path = require('path')
1+
const path = require('node:path')
22

33
const globPattern = './packages/*/*/tsconfig.json'
44

55
// in normal cases this is not needed because the __dirname would be the root
66
const absoluteGlobPath = path.join(__dirname, globPattern)
77

8-
module.exports = require('../baseEslintConfig.cjs')(absoluteGlobPath)
8+
module.exports = require('../base.eslintrc.cjs')(absoluteGlobPath)

tests/importXResolverV3/eslint.config.js renamed to tests/importXResolverV3/eslint.config.cjs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
const path = require('path')
2-
const importX = require('eslint-plugin-import-x')
1+
const path = require('node:path')
32

4-
const { createTypeScriptImportResolver } = require('../..')
3+
const {
4+
createTypeScriptImportResolver,
5+
} = require('eslint-import-resolver-typescript')
6+
const importX = require('eslint-plugin-import-x')
57

68
const globPattern = './packages/*/tsconfig.json'
79

810
// in normal cases this is not needed because the __dirname would be the root
911
const absoluteGlobPath = path.join(__dirname, globPattern)
1012

11-
const base = require('../baseEslintConfig.cjs')()
13+
const base = require('../base.eslintrc.cjs')()
1214

1315
module.exports =
14-
// don't run on node 16 because lacking of `structuredClone`
16+
// eslint-disable-next-line no-magic-numbers -- don't run on node 16 because lacking of `structuredClone`
1517
+process.versions.node.split('.')[0] <= 16
1618
? {}
1719
: {
1820
files: ['**/*.ts', '**/*.tsx'],
1921
plugins: {
20-
import: importX,
22+
'import-x': importX,
2123
},
2224
settings: {
2325
...importX.flatConfigs.typescript.settings,
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('../../baseEslintConfig.cjs')(__dirname)
1+
module.exports = require('../../base.eslintrc.cjs')(__dirname)
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('../../baseEslintConfig.cjs')(__dirname)
1+
module.exports = require('../../base.eslintrc.cjs')(__dirname)

0 commit comments

Comments
 (0)