From a59f3931c6b7c1c00c1b8f528ff4dff10611caa8 Mon Sep 17 00:00:00 2001 From: Christian Emmer <10749361+emmercm@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:05:22 -0800 Subject: [PATCH 1/8] Chore: update dorny/paths-filter to v3 (#1401) --- .github/workflows/gh-pages.yml | 2 +- .github/workflows/node-compile.yml | 2 +- .github/workflows/node-test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 2d7dbf3f0..b043622a7 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -39,7 +39,7 @@ jobs: with: ref: ${{ env.ref }} - id: filter - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v3 with: filters: | changes: diff --git a/.github/workflows/node-compile.yml b/.github/workflows/node-compile.yml index 93fc8d1cf..284739db7 100644 --- a/.github/workflows/node-compile.yml +++ b/.github/workflows/node-compile.yml @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/checkout@v4 - id: filter - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v3 with: filters: | changes: diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index 3ab1d6f47..f1db5f783 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -36,7 +36,7 @@ jobs: with: ref: ${{ env.ref }} - id: filter - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v3 with: filters: | changes: From b20660607e3b1cf3e47d0a052112c1cbb5292110 Mon Sep 17 00:00:00 2001 From: Christian Emmer <10749361+emmercm@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:13:41 -0800 Subject: [PATCH 2/8] CI: fix hard link writing tests (#1402) --- .../candidates/candidateWriter.test.ts | 187 ++++++++++++++---- 1 file changed, 144 insertions(+), 43 deletions(-) diff --git a/test/modules/candidates/candidateWriter.test.ts b/test/modules/candidates/candidateWriter.test.ts index 0103c603c..45ca3e7a7 100644 --- a/test/modules/candidates/candidateWriter.test.ts +++ b/test/modules/candidates/candidateWriter.test.ts @@ -62,6 +62,7 @@ async function walkAndStat(dirPath: string): Promise<[string, Stats][]> { stats.atime = new Date(0); stats.atimeMs = 0; // Hard-code properties that can change with hard-linking + stats.ctime = new Date(0); stats.ctimeMs = 0; stats.nlink = 0; } catch { @@ -1960,8 +1961,8 @@ describe('raw', () => { ); }); -describe.each([[true], [false]])('link with symlink: %s', (symlink) => { - it('should not write if the output is the input', async () => { +describe('link', () => { + test.each([[true], [false]])('should not write if the output is the input', async (symlink) => { await copyFixturesToTemp(async (inputTemp) => { // Given const options = new Options({ commands: ['link', 'test'], symlink }); @@ -1977,10 +1978,41 @@ describe.each([[true], [false]])('link with symlink: %s', (symlink) => { }); }); - it('should not write anything if the output exists and not overwriting', async () => { + test.each([[true], [false]])( + 'should not write anything if the output exists and not overwriting', + async (symlink) => { + await copyFixturesToTemp(async (inputTemp, outputTemp) => { + // Given + const options = new Options({ commands: ['link', 'test'], symlink }); + const inputFilesBefore = await walkAndStat(inputTemp); + await expect(walkAndStat(outputTemp)).resolves.toHaveLength(0); + + // And we've written once + await candidateWriter(options, inputTemp, '**/*', undefined, outputTemp); + + // And files were written + const outputFilesBefore = await walkAndStat(outputTemp); + expect(outputFilesBefore).not.toHaveLength(0); + for (const [, stats] of outputFilesBefore) { + expect(stats.isSymbolicLink()).toEqual(symlink); + } + + // When we write again + await candidateWriter(options, inputTemp, '**/*', undefined, outputTemp); + + // Then the output wasn't touched + await expect(walkAndStat(outputTemp)).resolves.toEqual(outputFilesBefore); + + // And the input files weren't touched + await expect(walkAndStat(inputTemp)).resolves.toMatchObject(inputFilesBefore); + }); + }, + ); + + it('should write if the output is expected and overwriting symlinks', async () => { await copyFixturesToTemp(async (inputTemp, outputTemp) => { // Given - const options = new Options({ commands: ['link', 'test'], symlink }); + const options = new Options({ commands: ['link', 'test'], symlink: true }); const inputFilesBefore = await walkAndStat(inputTemp); await expect(walkAndStat(outputTemp)).resolves.toHaveLength(0); @@ -1991,24 +2023,40 @@ describe.each([[true], [false]])('link with symlink: %s', (symlink) => { const outputFilesBefore = await walkAndStat(outputTemp); expect(outputFilesBefore).not.toHaveLength(0); for (const [, stats] of outputFilesBefore) { - expect(stats.isSymbolicLink()).toEqual(symlink); + expect(stats.isSymbolicLink()).toEqual(true); } // When we write again - await candidateWriter(options, inputTemp, '**/*', undefined, outputTemp); + await candidateWriter( + { + ...options, + overwrite: true, + }, + inputTemp, + '**/*', + undefined, + outputTemp, + ); - // Then the output wasn't touched - await expect(walkAndStat(outputTemp)).resolves.toEqual(outputFilesBefore); + // Then the output was touched because the symlinks were recreated + const outputFilesAfter = await walkAndStat(outputTemp); + expect(outputFilesAfter.map((pair) => pair[0])).toEqual( + outputFilesBefore.map((pair) => pair[0]), + ); + expect(outputFilesAfter).not.toEqual(outputFilesBefore); + for (const [, stats] of outputFilesAfter) { + expect(stats.isSymbolicLink()).toEqual(true); + } // And the input files weren't touched await expect(walkAndStat(inputTemp)).resolves.toMatchObject(inputFilesBefore); }); }); - it('should write if the output is expected and overwriting', async () => { + it('should write if the output is expected and overwriting hard links', async () => { await copyFixturesToTemp(async (inputTemp, outputTemp) => { // Given - const options = new Options({ commands: ['link', 'test'], symlink }); + const options = new Options({ commands: ['link', 'test'], symlink: false }); const inputFilesBefore = await walkAndStat(inputTemp); await expect(walkAndStat(outputTemp)).resolves.toHaveLength(0); @@ -2019,7 +2067,7 @@ describe.each([[true], [false]])('link with symlink: %s', (symlink) => { const outputFilesBefore = await walkAndStat(outputTemp); expect(outputFilesBefore).not.toHaveLength(0); for (const [, stats] of outputFilesBefore) { - expect(stats.isSymbolicLink()).toEqual(symlink); + expect(stats.isSymbolicLink()).toEqual(false); } // When we write again @@ -2034,14 +2082,14 @@ describe.each([[true], [false]])('link with symlink: %s', (symlink) => { outputTemp, ); - // Then the output was touched + // Then the output is the same as before because the same hard links were recreated const outputFilesAfter = await walkAndStat(outputTemp); expect(outputFilesAfter.map((pair) => pair[0])).toEqual( outputFilesBefore.map((pair) => pair[0]), ); - expect(outputFilesAfter).not.toEqual(outputFilesBefore); + expect(outputFilesAfter).toEqual(outputFilesBefore); for (const [, stats] of outputFilesAfter) { - expect(stats.isSymbolicLink()).toEqual(symlink); + expect(stats.isSymbolicLink()).toEqual(false); } // And the input files weren't touched @@ -2049,10 +2097,10 @@ describe.each([[true], [false]])('link with symlink: %s', (symlink) => { }); }); - it('should write if the output is not expected and overwriting invalid', async () => { + it('should write if the output is not expected and overwriting invalid symlinks', async () => { await copyFixturesToTemp(async (inputTemp, outputTemp) => { // Given - const options = new Options({ commands: ['link', 'test'], symlink }); + const options = new Options({ commands: ['link', 'test'], symlink: true }); const inputFilesBefore = await walkAndStat(inputTemp); await expect(walkAndStat(outputTemp)).resolves.toHaveLength(0); @@ -2063,7 +2111,7 @@ describe.each([[true], [false]])('link with symlink: %s', (symlink) => { const outputFilesBefore = await walkAndStat(outputTemp); expect(outputFilesBefore).not.toHaveLength(0); for (const [, stats] of outputFilesBefore) { - expect(stats.isSymbolicLink()).toEqual(symlink); + expect(stats.isSymbolicLink()).toEqual(true); } // And the files are made invalid @@ -2087,47 +2135,100 @@ describe.each([[true], [false]])('link with symlink: %s', (symlink) => { outputTemp, ); - // Then the output was touched + // Then the output was touched because the symlinks were recreated const outputFilesAfter = await walkAndStat(outputTemp); expect(outputFilesAfter.map((pair) => pair[0])).toEqual( outputFilesBefore.map((pair) => pair[0]), ); expect(outputFilesAfter).not.toEqual(outputFilesBefore); for (const [, stats] of outputFilesAfter) { - expect(stats.isSymbolicLink()).toEqual(symlink); + expect(stats.isSymbolicLink()).toEqual(true); } // And the input files weren't touched await expect(walkAndStat(inputTemp)).resolves.toMatchObject(inputFilesBefore); }); }); -}); -it('should write relative symlinks', async () => { - await copyFixturesToTemp(async (inputTemp, outputTemp) => { - // Given - const options = new Options({ - commands: ['link', 'test'], - symlink: true, - symlinkRelative: true, - }); - await expect(walkAndStat(outputTemp)).resolves.toHaveLength(0); + it('should write if the output is not expected and overwriting invalid hard links', async () => { + await copyFixturesToTemp(async (inputTemp, outputTemp) => { + // Given + const options = new Options({ commands: ['link', 'test'], symlink: false }); + const inputFilesBefore = await walkAndStat(inputTemp); + await expect(walkAndStat(outputTemp)).resolves.toHaveLength(0); - // When we write - await candidateWriter(options, inputTemp, '**/*', undefined, outputTemp); + // And we've written once + await candidateWriter(options, inputTemp, '**/*', undefined, outputTemp); + + // And files were written + const outputFilesBefore = await walkAndStat(outputTemp); + expect(outputFilesBefore).not.toHaveLength(0); + for (const [, stats] of outputFilesBefore) { + expect(stats.isSymbolicLink()).toEqual(false); + } + + // And the files are made invalid + await Promise.all( + outputFilesBefore.map(async ([filePath]) => { + const resolvedPath = path.join(outputTemp, filePath); + await fsPoly.rm(resolvedPath); + await fsPoly.touch(resolvedPath); + }), + ); + + // When we write again + await candidateWriter( + { + ...options, + overwriteInvalid: true, + }, + inputTemp, + '**/*', + undefined, + outputTemp, + ); - // Then files were written - const outputFilesBefore = await walkAndStat(outputTemp); - expect(outputFilesBefore).not.toHaveLength(0); - for (const [outputPath, stats] of outputFilesBefore) { - expect(stats.isSymbolicLink()).toEqual(true); - const outputPathAbsolute = path.resolve(path.join(outputTemp, outputPath)); - const outputPathResolved = path.resolve( - path.dirname(outputPathAbsolute), - await fsPoly.readlink(outputPathAbsolute), + // Then the output is the same as before because the same hard links were recreated + const outputFilesAfter = await walkAndStat(outputTemp); + expect(outputFilesAfter.map((pair) => pair[0])).toEqual( + outputFilesBefore.map((pair) => pair[0]), ); - await expect(fsPoly.exists(outputPathResolved)).resolves.toEqual(true); - expect(outputPathResolved.startsWith(inputTemp)).toEqual(true); - } + expect(outputFilesAfter).toEqual(outputFilesBefore); + for (const [, stats] of outputFilesAfter) { + expect(stats.isSymbolicLink()).toEqual(false); + } + + // And the input files weren't touched + await expect(walkAndStat(inputTemp)).resolves.toMatchObject(inputFilesBefore); + }); + }); + + it('should write relative symlinks', async () => { + await copyFixturesToTemp(async (inputTemp, outputTemp) => { + // Given + const options = new Options({ + commands: ['link', 'test'], + symlink: true, + symlinkRelative: true, + }); + await expect(walkAndStat(outputTemp)).resolves.toHaveLength(0); + + // When we write + await candidateWriter(options, inputTemp, '**/*', undefined, outputTemp); + + // Then files were written + const outputFilesBefore = await walkAndStat(outputTemp); + expect(outputFilesBefore).not.toHaveLength(0); + for (const [outputPath, stats] of outputFilesBefore) { + expect(stats.isSymbolicLink()).toEqual(true); + const outputPathAbsolute = path.resolve(path.join(outputTemp, outputPath)); + const outputPathResolved = path.resolve( + path.dirname(outputPathAbsolute), + await fsPoly.readlink(outputPathAbsolute), + ); + await expect(fsPoly.exists(outputPathResolved)).resolves.toEqual(true); + expect(outputPathResolved.startsWith(inputTemp)).toEqual(true); + } + }); }); }); From f239e1027fa12466955ba121c2dab73c84f9e108 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:23:13 +0000 Subject: [PATCH 3/8] Chore: update ESLint (#1397) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian Emmer <10749361+emmercm@users.noreply.github.com> --- package-lock.json | 185 +++++++++++++++++++++++----------------------- package.json | 10 +-- 2 files changed, 99 insertions(+), 96 deletions(-) diff --git a/package-lock.json b/package-lock.json index 855394aa9..0b775a85e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,18 +65,18 @@ "@types/which": "3.0.4", "@types/xml2js": "0.4.14", "@types/yargs": "17.0.33", - "@typescript-eslint/eslint-plugin": "8.11.0", - "@typescript-eslint/parser": "8.11.0", + "@typescript-eslint/eslint-plugin": "8.18.2", + "@typescript-eslint/parser": "8.18.2", "auto-changelog": "2.5.0", "caxa": "3.0.1", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", - "eslint-plugin-jest": "28.8.3", - "eslint-plugin-jsdoc": "50.4.3", + "eslint-plugin-jest": "28.10.0", + "eslint-plugin-jsdoc": "50.6.1", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-simple-import-sort": "12.1.1", - "eslint-plugin-unicorn": "56.0.0", + "eslint-plugin-unicorn": "56.0.1", "husky": "9.1.6", "jest": "29.7.0", "jest-extended": "4.0.2", @@ -2703,17 +2703,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.11.0.tgz", - "integrity": "sha512-KhGn2LjW1PJT2A/GfDpiyOfS4a8xHQv2myUagTM5+zsormOmBlYsnQ6pobJ8XxJmh6hnHwa2Mbe3fPrDJoDhbA==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.2.tgz", + "integrity": "sha512-adig4SzPLjeQ0Tm+jvsozSGiCliI2ajeURDGHjZ2llnA+A67HihCQ+a3amtPhUakd1GlwHxSRvzOZktbEvhPPg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.11.0", - "@typescript-eslint/type-utils": "8.11.0", - "@typescript-eslint/utils": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/type-utils": "8.18.2", + "@typescript-eslint/utils": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -2728,25 +2728,21 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", - "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.2.tgz", + "integrity": "sha512-y7tcq4StgxQD4mDr9+Jb26dZ+HTZ/SkfqpXSiqeUXZHxOUyjWDKsmwKhJ0/tApR08DgOhrFAoAhyB80/p3ViuA==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.11.0", - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/typescript-estree": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/typescript-estree": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", "debug": "^4.3.4" }, "engines": { @@ -2757,23 +2753,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz", - "integrity": "sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.2.tgz", + "integrity": "sha512-YJFSfbd0CJjy14r/EvWapYgV4R5CHzptssoag2M7y3Ra7XNta6GPAJPPP5KGB9j14viYXyrzRO5GkX7CRfo8/g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0" + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2784,14 +2776,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.11.0.tgz", - "integrity": "sha512-ItiMfJS6pQU0NIKAaybBKkuVzo6IdnAhPFZA/2Mba/uBjuPQPet/8+zh5GtLHwmuFRShZx+8lhIs7/QeDHflOg==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.2.tgz", + "integrity": "sha512-AB/Wr1Lz31bzHfGm/jgbFR0VB0SML/hd2P1yxzKDM48YmP7vbyJNHRExUE/wZsQj2wUCvbWH8poNHFuxLqCTnA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.11.0", - "@typescript-eslint/utils": "8.11.0", + "@typescript-eslint/typescript-estree": "8.18.2", + "@typescript-eslint/utils": "8.18.2", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -2802,16 +2794,15 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.11.0.tgz", - "integrity": "sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.2.tgz", + "integrity": "sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==", "dev": true, "license": "MIT", "engines": { @@ -2823,14 +2814,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz", - "integrity": "sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.2.tgz", + "integrity": "sha512-WXAVt595HjpmlfH4crSdM/1bcsqh+1weFRWIa9XMTx/XHZ9TCKMcr725tLYqWOgzKdeDrqVHxFotrvWcEsk2Tg==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2845,23 +2836,21 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.11.0.tgz", - "integrity": "sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.2.tgz", + "integrity": "sha512-Cr4A0H7DtVIPkauj4sTSXVl+VBWewE9/o40KcF3TV9aqDEOWoXF3/+oRXNby3DYzZeCATvbdksYsGZzplwnK/Q==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.11.0", - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/typescript-estree": "8.11.0" + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/typescript-estree": "8.18.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2871,18 +2860,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz", - "integrity": "sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.2.tgz", + "integrity": "sha512-zORcwn4C3trOWiCqFQP1x6G3xTRyZ1LYydnj51cRnJ6hxBlr/cKPckk+PKPUw/fXmvfKTcw7bwY3w9izgx5jZw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.11.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.18.2", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2892,6 +2882,19 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -5213,9 +5216,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "28.8.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.8.3.tgz", - "integrity": "sha512-HIQ3t9hASLKm2IhIOqnu+ifw7uLZkIlR7RYNv7fMcEi/p0CIiJmfriStQS2LDkgtY4nyLbIZAD+JL347Yc2ETQ==", + "version": "28.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.10.0.tgz", + "integrity": "sha512-hyMWUxkBH99HpXT3p8hc7REbEZK3D+nk8vHXGgpB+XXsi0gO4PxMSP+pjfUzb67GnV9yawV9a53eUmcde1CCZA==", "dev": true, "license": "MIT", "dependencies": { @@ -5239,9 +5242,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "50.4.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.4.3.tgz", - "integrity": "sha512-uWtwFxGRv6B8sU63HZM5dAGDhgsatb+LONwmILZJhdRALLOkCX2HFZhdL/Kw2ls8SQMAVEfK+LmnEfxInRN8HA==", + "version": "50.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.1.tgz", + "integrity": "sha512-UWyaYi6iURdSfdVVqvfOs2vdCVz0J40O/z/HTsv2sFjdjmdlUI/qlKLOTmwbPQ2tAfQnE5F9vqx+B+poF71DBQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -5265,9 +5268,9 @@ } }, "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -5278,15 +5281,15 @@ } }, "node_modules/eslint-plugin-jsdoc/node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5337,9 +5340,9 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "56.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-56.0.0.tgz", - "integrity": "sha512-aXpddVz/PQMmd69uxO98PA4iidiVNvA0xOtbpUoz1WhBd4RxOQQYqN618v68drY0hmy5uU2jy1bheKEVWBjlPw==", + "version": "56.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-56.0.1.tgz", + "integrity": "sha512-FwVV0Uwf8XPfVnKSGpMg7NtlZh0G0gBarCaFcMUOoqPxXryxdYxTRRv4kH6B9TFCVIrjRXG+emcxIk2ayZilog==", "dev": true, "license": "MIT", "dependencies": { @@ -5371,9 +5374,9 @@ } }, "node_modules/eslint-plugin-unicorn/node_modules/globals": { - "version": "15.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.11.0.tgz", - "integrity": "sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==", + "version": "15.14.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.14.0.tgz", + "integrity": "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 3045556f3..a5a5fac0a 100644 --- a/package.json +++ b/package.json @@ -120,18 +120,18 @@ "@types/which": "3.0.4", "@types/xml2js": "0.4.14", "@types/yargs": "17.0.33", - "@typescript-eslint/eslint-plugin": "8.11.0", - "@typescript-eslint/parser": "8.11.0", + "@typescript-eslint/eslint-plugin": "8.18.2", + "@typescript-eslint/parser": "8.18.2", "auto-changelog": "2.5.0", "caxa": "3.0.1", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", - "eslint-plugin-jest": "28.8.3", - "eslint-plugin-jsdoc": "50.4.3", + "eslint-plugin-jest": "28.10.0", + "eslint-plugin-jsdoc": "50.6.1", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-simple-import-sort": "12.1.1", - "eslint-plugin-unicorn": "56.0.0", + "eslint-plugin-unicorn": "56.0.1", "husky": "9.1.6", "jest": "29.7.0", "jest-extended": "4.0.2", From 6b76bc3d10afca08158f03ad17db6758cbc72f40 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:32:49 +0000 Subject: [PATCH 4/8] Chore: update dev dependencies (#1395) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 24 ++++++++++++------------ package.json | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0b775a85e..80f01fa1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,7 @@ "@types/figlet": "1.7.0", "@types/jest": "29.5.14", "@types/micromatch": "4.0.9", - "@types/node": "20.17.0", + "@types/node": "20.17.10", "@types/semver": "7.5.8", "@types/tar": "6.1.13", "@types/unzipper": "0.10.10", @@ -77,10 +77,10 @@ "eslint-plugin-prettier": "5.2.1", "eslint-plugin-simple-import-sort": "12.1.1", "eslint-plugin-unicorn": "56.0.1", - "husky": "9.1.6", + "husky": "9.1.7", "jest": "29.7.0", "jest-extended": "4.0.2", - "prettier": "3.3.3", + "prettier": "3.4.2", "ts-jest": "29.2.5", "ts-node": "10.9.2", "typescript": "5.5.4", @@ -2607,9 +2607,9 @@ } }, "node_modules/@types/node": { - "version": "20.17.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.0.tgz", - "integrity": "sha512-a7zRo0f0eLo9K5X9Wp5cAqTUNGzuFLDG2R7C4HY2BhcMAsxgSPuRvAC1ZB6QkuUQXf0YZAgfOX2ZyrBa2n4nHQ==", + "version": "20.17.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", + "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", "dev": true, "license": "MIT", "dependencies": { @@ -6355,9 +6355,9 @@ } }, "node_modules/husky": { - "version": "9.1.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", - "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, "license": "MIT", "bin": { @@ -9716,9 +9716,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index a5a5fac0a..6bf4b232f 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "@types/figlet": "1.7.0", "@types/jest": "29.5.14", "@types/micromatch": "4.0.9", - "@types/node": "20.17.0", + "@types/node": "20.17.10", "@types/semver": "7.5.8", "@types/tar": "6.1.13", "@types/unzipper": "0.10.10", @@ -132,10 +132,10 @@ "eslint-plugin-prettier": "5.2.1", "eslint-plugin-simple-import-sort": "12.1.1", "eslint-plugin-unicorn": "56.0.1", - "husky": "9.1.6", + "husky": "9.1.7", "jest": "29.7.0", "jest-extended": "4.0.2", - "prettier": "3.3.3", + "prettier": "3.4.2", "ts-jest": "29.2.5", "ts-node": "10.9.2", "typescript": "5.5.4", From 0702a40834d11d248c7c60c3011205743e113f16 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 20:00:53 +0000 Subject: [PATCH 5/8] Chore: update dependency eslint to v9 (#1322) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian Emmer <10749361+emmercm@users.noreply.github.com> --- .eslintrc | 161 -------- eslint.config.mjs | 208 ++++++++++ package-lock.json | 389 +++++++----------- package.json | 2 +- src/modules/argumentsParser.ts | 2 - .../candidates/candidatePatchGenerator.ts | 1 - src/modules/candidates/candidatePreferer.ts | 4 +- src/modules/candidates/candidateWriter.ts | 1 - src/types/files/archives/chd/chd.ts | 2 - src/types/files/archives/maxcso/cso.ts | 2 - src/types/files/archives/maxcso/dax.ts | 2 - src/types/files/archives/maxcso/zso.ts | 2 - src/types/files/archives/nkitIso.ts | 4 +- src/types/files/archives/rar.ts | 2 - src/types/files/archives/sevenZip/gzip.ts | 2 - src/types/files/archives/sevenZip/sevenZip.ts | 2 - src/types/files/archives/sevenZip/z.ts | 2 - .../files/archives/sevenZip/zipSpanned.ts | 2 - src/types/files/archives/sevenZip/zipX.ts | 2 - src/types/files/archives/tar.ts | 2 - src/types/files/archives/zip.ts | 2 - src/types/outputFactory.ts | 1 - src/types/patches/ppfPatch.ts | 1 - src/types/patches/vcdiffPatch.ts | 2 - test/console/progressBarFake.ts | 2 - test/modules/dats/datMergerSplitter.test.ts | 2 +- 26 files changed, 365 insertions(+), 439 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslint.config.mjs diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index e4a44a2eb..000000000 --- a/.eslintrc +++ /dev/null @@ -1,161 +0,0 @@ -{ - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:jsdoc/recommended-typescript-error", - "plugin:jest/recommended", - "plugin:prettier/recommended" // MUST BE LAST! - ], - "plugins": [ - "@typescript-eslint", - "simple-import-sort", - "jest", - "unicorn" - ], - - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "./tsconfig.json", - "sourceType": "module" - }, - "ignorePatterns": ["dist/**"], - - "env": { - "jest/globals": true - }, - - "rules": { - // ***** Files ***** - "unicorn/no-empty-file": "error", - "unicorn/filename-case": ["error", { - "case": "camelCase" - }], - - // ***** Imports ***** - "unicorn/prefer-node-protocol": "error", - "simple-import-sort/exports": "error", - "simple-import-sort/imports": "error", - - // ***** JSDoc ***** - "jsdoc/require-jsdoc": ["error", { - // Require on public parts of classes - "checkConstructors": false, - "contexts": [ - "ClassDeclaration", - // TODO(cemmer): require private methods as well - "MethodDefinition[accessibility!=private][key.name!=/^(get|set|with)[A-Z][a-zA-Z]+/]" - ] - }], - "jsdoc/require-param": "off", - "jsdoc/require-returns": "off", - "jsdoc/no-blank-blocks": "error", - - // ***** Types ***** - "unicorn/no-null": "error", - - // ***** Promises ***** - // Disallow awaiting a value that is not a Thenable. - "@typescript-eslint/await-thenable": "error", - // Disallow async functions which have no `await` expression. - "@typescript-eslint/require-await": "error", - // Enforce consistent returning of awaited values. - "@typescript-eslint/return-await": "error", - // Require any function or method that returns a Promise to be marked async. - "@typescript-eslint/promise-function-async": ["error"], - - // ***** Classes ***** - "@typescript-eslint/prefer-readonly": "error", - "unicorn/new-for-builtins": "error", - "unicorn/no-static-only-class": "error", - - // ***** Functions ***** - // Require explicit return types on functions and class methods. - "@typescript-eslint/explicit-function-return-type": "error", - "unicorn/prefer-default-parameters": "error", - - // ***** Errors ***** - "unicorn/catch-error-name": "error", - "unicorn/prefer-optional-catch-binding": "error", - - // ***** Operands ***** - "@typescript-eslint/prefer-nullish-coalescing": "error", - - // ***** Conditionals ***** - // Don't allow unnecessary conditional checks, such as when a value is always true, which can also help catch cases - // such as accidentally checking `if([]){}` vs. `if([].length){}` - "@typescript-eslint/strict-boolean-expressions": ["error", { - "allowAny": true, - "allowNullableBoolean": true, - "allowNullableString": true - }], - // Don't allow truthy or falsey conditionals on array lengths - "unicorn/explicit-length-check": "error", - - // ***** Loops ***** - "unicorn/no-for-loop": "error", - - // ***** Objects ***** - "@typescript-eslint/no-unused-vars": ["error", { - // Allow the use of destructuring to remove keys from an object - "ignoreRestSiblings": true - }], - - // ***** Arrays ***** - "no-restricted-syntax": ["error", { - "selector": "CallExpression[callee.property.name='push'] > SpreadElement", - "message": "Array#push(...Array) can cause 'call stack size exceeded' runtime errors when pushing many values, prefer 'Array = [...Array, ...Array]'" - }], - "unicorn/no-new-array": "error", - // TypeScript doesn't do a good job of reporting indexed values as potentially undefined, such as `[1,2,3][999]` - "unicorn/prefer-at": "error", - // Try to enforce early terminations of loops, rather than statements such as `.find(x=>x)[0]` - "unicorn/prefer-array-find": ["error", {"checkFromLast": false}], - "unicorn/prefer-array-flat": "error", - "unicorn/prefer-array-flat-map": "error", - "unicorn/prefer-includes": "error", - "unicorn/prefer-object-from-entries": "error", - - // ***** Numbers ***** - "unicorn/no-zero-fractions": "error", - "unicorn/numeric-separators-style": "error", - "unicorn/prefer-number-properties": "error", - - // ***** Strings ***** - "unicorn/prefer-code-point": "error", - - // ********** Recommended Overrides ********** - - // ***** eslint:recommended ***** - // Referencing ASCII characters <32 is entirely legitimate - "no-control-regex": "off", - - // ***** plugin:@typescript-eslint/recommended ***** - // There are a few places where this needs to be allowed, but only a few, so warn on them - "@typescript-eslint/no-floating-promises": "warn", - // There are a few places where this needs to be allowed, but only a few, so warn on them - "@typescript-eslint/no-unused-expressions": "warn", - - // ***** airbnb-base, airbnb-typescript/base ***** - "no-await-in-loop": "off", - "no-bitwise": "off", - - // ***** plugin:jest/recommended ***** - // A lot of test files define their own expect functions - "jest/expect-expect": "off" - }, - - "overrides": [ - { - "files": [ - "test/**/*.ts", - // TODO(cemmer) - "src/polyfill/**/*.ts", - "src/types/files/**/*.ts", - "src/types/patches/**/*.ts" - ], - "rules": { - "jsdoc/require-jsdoc": "off" - } - } - ] -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..20cfa0fd2 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,208 @@ +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; +import typescriptEslint from '@typescript-eslint/eslint-plugin'; +import tsParser from '@typescript-eslint/parser'; +import jest from 'eslint-plugin-jest'; +import simpleImportSort from 'eslint-plugin-simple-import-sort'; +import unicorn from 'eslint-plugin-unicorn'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +export default [ + { + ignores: ['dist/**/*'], + }, + ...compat.extends( + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:jsdoc/recommended-typescript-error', + 'plugin:jest/recommended', + 'plugin:prettier/recommended', // MUST BE LAST! + ), + { + files: ['**/*.ts'], + + plugins: { + '@typescript-eslint': typescriptEslint, + 'simple-import-sort': simpleImportSort, + jest, + unicorn, + }, + + languageOptions: { + parser: tsParser, + parserOptions: { + project: './tsconfig.json', + }, + sourceType: 'module', + + globals: { + ...jest.environments.globals.globals, + }, + }, + + rules: { + // ***** Files ***** + 'unicorn/no-empty-file': 'error', + 'unicorn/filename-case': [ + 'error', + { + case: 'camelCase', + }, + ], + + // ***** Imports ***** + 'unicorn/prefer-node-protocol': 'error', + 'simple-import-sort/exports': 'error', + 'simple-import-sort/imports': 'error', + + // ***** JSDoc ***** + 'jsdoc/require-jsdoc': [ + 'error', + { + // Require on public parts of classes + checkConstructors: false, + + contexts: [ + 'ClassDeclaration', + // TODO(cemmer): require private methods as well + 'MethodDefinition[accessibility!=private][key.name!=/^(get|set|with)[A-Z][a-zA-Z]+/]', + ], + }, + ], + 'jsdoc/require-param': 'off', + 'jsdoc/require-returns': 'off', + 'jsdoc/no-blank-blocks': 'error', + + // ***** Types ***** + 'unicorn/no-null': 'error', + + // ***** Promises ***** + // Disallow awaiting a value that is not a Thenable. + '@typescript-eslint/await-thenable': 'error', + // Disallow async functions which have no `await` expression. + '@typescript-eslint/require-await': 'error', + // Enforce consistent returning of awaited values. + '@typescript-eslint/return-await': 'error', + // Require any function or method that returns a Promise to be marked async. + '@typescript-eslint/promise-function-async': ['error'], + + // ***** Classes ***** + '@typescript-eslint/prefer-readonly': 'error', + 'unicorn/new-for-builtins': 'error', + 'unicorn/no-static-only-class': 'error', + + // ***** Functions ***** + // Require explicit return types on functions and class methods. + '@typescript-eslint/explicit-function-return-type': 'error', + 'unicorn/prefer-default-parameters': 'error', + + // ***** Errors ***** + 'unicorn/catch-error-name': 'error', + 'unicorn/prefer-optional-catch-binding': 'error', + + // ***** Operands ***** + '@typescript-eslint/prefer-nullish-coalescing': 'error', + + // ***** Conditionals ***** + // Don't allow unnecessary conditional checks, such as when a value is always true, which can also help catch cases + // such as accidentally checking `if([]){}` vs. `if([].length){}` + '@typescript-eslint/strict-boolean-expressions': [ + 'error', + { + allowAny: true, + allowNullableBoolean: true, + allowNullableString: true, + }, + ], + // Don't allow truthy or falsey conditionals on array lengths + 'unicorn/explicit-length-check': 'error', + + // ***** Loops ***** + 'unicorn/no-for-loop': 'error', + + // ***** Objects ***** + '@typescript-eslint/no-unused-vars': [ + 'error', + { + // Allow the use of destructuring to remove keys from an object + ignoreRestSiblings: true, + }, + ], + + // ***** Arrays ***** + 'no-restricted-syntax': [ + 'error', + { + selector: "CallExpression[callee.property.name='push'] > SpreadElement", + message: + "Array#push(...Array) can cause 'call stack size exceeded' runtime errors when pushing many values, prefer 'Array = [...Array, ...Array]'", + }, + ], + 'unicorn/no-new-array': 'error', + // TypeScript doesn't do a good job of reporting indexed values as potentially undefined, such as `[1,2,3][999]` + 'unicorn/prefer-at': 'error', + // Try to enforce early terminations of loops, rather than statements such as `.find(x=>x)[0]` + 'unicorn/prefer-array-find': [ + 'error', + { + checkFromLast: false, + }, + ], + 'unicorn/prefer-array-flat': 'error', + 'unicorn/prefer-array-flat-map': 'error', + 'unicorn/prefer-includes': 'error', + 'unicorn/prefer-object-from-entries': 'error', + + // ***** Numbers ***** + 'unicorn/no-zero-fractions': 'error', + 'unicorn/numeric-separators-style': 'error', + 'unicorn/prefer-number-properties': 'error', + + // ***** Strings ***** + 'unicorn/prefer-code-point': 'error', + + // ********** Recommended Overrides ********** + + // ***** eslint:recommended ***** + // Referencing ASCII characters <32 is entirely legitimate + 'no-control-regex': 'off', + + // ***** plugin:@typescript-eslint/recommended ***** + // There are a few places where this needs to be allowed, but only a few, so warn on them + '@typescript-eslint/no-floating-promises': 'warn', + // There are a few places where this needs to be allowed, but only a few, so warn on them + '@typescript-eslint/no-unused-expressions': 'warn', + + // ***** airbnb-base, airbnb-typescript/base ***** + 'no-await-in-loop': 'off', + 'no-bitwise': 'off', + + // ***** plugin:jest/recommended ***** + // A lot of test files define their own expect functions + 'jest/expect-expect': 'off', + }, + }, + { + files: [ + 'test/**/*.ts', + // TODO(cemmer) + 'src/polyfill/**/*.ts', + 'src/types/files/**/*.ts', + 'src/types/patches/**/*.ts', + ], + + rules: { + 'jsdoc/require-jsdoc': 'off', + }, + }, +]; diff --git a/package-lock.json b/package-lock.json index 80f01fa1f..3898f0539 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,7 +69,7 @@ "@typescript-eslint/parser": "8.18.2", "auto-changelog": "2.5.0", "caxa": "3.0.1", - "eslint": "8.57.1", + "eslint": "9.9.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", "eslint-plugin-jest": "28.10.0", @@ -962,17 +962,56 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -980,7 +1019,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1011,13 +1050,23 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "version": "9.9.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", + "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", "dev": true, "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@fast-csv/format": { @@ -1053,46 +1102,6 @@ "integrity": "sha512-X5OzPA/Y2NG6IJUbIXLiGSCev0L4AwbOLUoO+dhrLzw70Qcd9S5QeC0SDAjtZZ3jVxvrtO5mRgCSAwpQMHPmhg==", "license": "MIT" }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -1107,13 +1116,19 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", + "node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", "dev": true, - "license": "BSD-3-Clause" + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@isaacs/cliui": { "version": "8.0.2", @@ -2895,13 +2910,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "license": "ISC" - }, "node_modules/7zip-bin": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.1.1.tgz", @@ -4710,19 +4718,6 @@ "node": ">=8" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -5005,43 +5000,38 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "version": "9.9.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", + "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.9.1", "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.0.2", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -5055,10 +5045,18 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -5267,37 +5265,6 @@ "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, - "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/espree": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.14.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/eslint-plugin-prettier": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", @@ -5374,9 +5341,9 @@ } }, "node_modules/eslint-plugin-unicorn/node_modules/globals": { - "version": "15.14.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.14.0.tgz", - "integrity": "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==", + "version": "15.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.11.0.tgz", + "integrity": "sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==", "dev": true, "license": "MIT", "engines": { @@ -5387,9 +5354,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -5397,7 +5364,7 @@ "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -5470,6 +5437,19 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -5497,18 +5477,31 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -5771,16 +5764,16 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/filelist": { @@ -5836,24 +5829,23 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true, "license": "ISC" }, @@ -6129,29 +6121,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globals/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -10142,69 +10118,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/package.json b/package.json index 6bf4b232f..659a59ed2 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@typescript-eslint/parser": "8.18.2", "auto-changelog": "2.5.0", "caxa": "3.0.1", - "eslint": "8.57.1", + "eslint": "9.9.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", "eslint-plugin-jest": "28.10.0", diff --git a/src/modules/argumentsParser.ts b/src/modules/argumentsParser.ts index 94ffd578d..466a365be 100644 --- a/src/modules/argumentsParser.ts +++ b/src/modules/argumentsParser.ts @@ -137,7 +137,6 @@ export default class ArgumentsParser { return yargsObj .middleware((middlewareArgv) => { // Ignore duplicate commands - // eslint-disable-next-line no-param-reassign middlewareArgv._ = middlewareArgv._.reduce(ArrayPoly.reduceUnique(), []); }, true) .check((checkArgv) => { @@ -862,7 +861,6 @@ export default class ArgumentsParser { }) .middleware((middlewareArgv) => { if (middlewareArgv.zipDatName) { - // eslint-disable-next-line no-param-reassign middlewareArgv.datThreads = 1; } }, true) diff --git a/src/modules/candidates/candidatePatchGenerator.ts b/src/modules/candidates/candidatePatchGenerator.ts index c37ca7621..5de563b5d 100644 --- a/src/modules/candidates/candidatePatchGenerator.ts +++ b/src/modules/candidates/candidatePatchGenerator.ts @@ -85,7 +85,6 @@ export default class CandidatePatchGenerator extends Module { // Possibly generate multiple new Parents for the ReleaseCandidates for (const releaseCandidate of releaseCandidates) { if (seenGames.has(releaseCandidate.getGame())) { - // eslint-disable-next-line no-continue continue; } diff --git a/src/modules/candidates/candidatePreferer.ts b/src/modules/candidates/candidatePreferer.ts index 775a7b1f2..fa3977824 100644 --- a/src/modules/candidates/candidatePreferer.ts +++ b/src/modules/candidates/candidatePreferer.ts @@ -45,7 +45,9 @@ export default class CandidatePreferer extends Module { 0, ); if (!totalReleaseCandidates) { - this.progressBar.logTrace(`${dat.getNameShort()}: no parent has candidates`); + this.progressBar.logTrace( + `${dat.getNameShort()}: no parent has candidates, not preferring candidates`, + ); return parentsToCandidates; } diff --git a/src/modules/candidates/candidateWriter.ts b/src/modules/candidates/candidateWriter.ts index 4092daa2d..0de704a73 100644 --- a/src/modules/candidates/candidateWriter.ts +++ b/src/modules/candidates/candidateWriter.ts @@ -348,7 +348,6 @@ export default class CandidateWriter extends Module { this.progressBar.logWarn( `${dat.getNameShort()}: ${releaseCandidate.getName()}: ${expectedFile.toString()}: can't test, expected size is unknown`, ); - // eslint-disable-next-line no-continue continue; } if (actualFile.getSize() !== expectedFile.getSize()) { diff --git a/src/types/files/archives/chd/chd.ts b/src/types/files/archives/chd/chd.ts index d03d4c754..2307adc87 100644 --- a/src/types/files/archives/chd/chd.ts +++ b/src/types/files/archives/chd/chd.ts @@ -26,7 +26,6 @@ export default class Chd extends Archive { private tempSingletonFilePath?: string; - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new Chd(filePath); } @@ -35,7 +34,6 @@ export default class Chd extends Archive { return ['.chd']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Chd.getExtensions()[0]; } diff --git a/src/types/files/archives/maxcso/cso.ts b/src/types/files/archives/maxcso/cso.ts index 8e649c7fc..2181c3fcc 100644 --- a/src/types/files/archives/maxcso/cso.ts +++ b/src/types/files/archives/maxcso/cso.ts @@ -2,7 +2,6 @@ import Archive from '../archive.js'; import Maxcso from './maxcso.js'; export default class Cso extends Maxcso { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new Cso(filePath); } @@ -11,7 +10,6 @@ export default class Cso extends Maxcso { return ['.cso']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Cso.getExtensions()[0]; } diff --git a/src/types/files/archives/maxcso/dax.ts b/src/types/files/archives/maxcso/dax.ts index 73107cffc..2b729cd15 100644 --- a/src/types/files/archives/maxcso/dax.ts +++ b/src/types/files/archives/maxcso/dax.ts @@ -2,7 +2,6 @@ import Archive from '../archive.js'; import Maxcso from './maxcso.js'; export default class Dax extends Maxcso { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new Dax(filePath); } @@ -11,7 +10,6 @@ export default class Dax extends Maxcso { return ['.dax']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Dax.getExtensions()[0]; } diff --git a/src/types/files/archives/maxcso/zso.ts b/src/types/files/archives/maxcso/zso.ts index 3dd463737..512dec080 100644 --- a/src/types/files/archives/maxcso/zso.ts +++ b/src/types/files/archives/maxcso/zso.ts @@ -2,7 +2,6 @@ import Archive from '../archive.js'; import Maxcso from './maxcso.js'; export default class Zso extends Maxcso { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new Zso(filePath); } @@ -11,7 +10,6 @@ export default class Zso extends Maxcso { return ['.zso']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Zso.getExtensions()[0]; } diff --git a/src/types/files/archives/nkitIso.ts b/src/types/files/archives/nkitIso.ts index 5f43825d9..d8c36c23b 100644 --- a/src/types/files/archives/nkitIso.ts +++ b/src/types/files/archives/nkitIso.ts @@ -7,7 +7,6 @@ import ArchiveEntry from './archiveEntry.js'; // @see https://wiki.gbatemp.net/wiki/NKit/NKitFormat export default class NkitIso extends Archive { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new NkitIso(filePath); } @@ -16,12 +15,11 @@ export default class NkitIso extends Archive { return ['.nkit.iso']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return NkitIso.getExtensions()[0]; } - // eslint-disable-next-line class-methods-use-this,@typescript-eslint/require-await + // eslint-disable-next-line @typescript-eslint/require-await async extractEntryToFile(): Promise { throw new ExpectedError("extraction isn't supported for NKit ISO files"); } diff --git a/src/types/files/archives/rar.ts b/src/types/files/archives/rar.ts index 76deaafff..f29d69994 100644 --- a/src/types/files/archives/rar.ts +++ b/src/types/files/archives/rar.ts @@ -12,7 +12,6 @@ import ArchiveEntry from './archiveEntry.js'; export default class Rar extends Archive { private static readonly EXTRACT_MUTEX = new Mutex(); - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new Rar(filePath); } @@ -21,7 +20,6 @@ export default class Rar extends Archive { return ['.rar']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Rar.getExtensions()[0]; } diff --git a/src/types/files/archives/sevenZip/gzip.ts b/src/types/files/archives/sevenZip/gzip.ts index ca5c4664e..f94f64a61 100644 --- a/src/types/files/archives/sevenZip/gzip.ts +++ b/src/types/files/archives/sevenZip/gzip.ts @@ -4,7 +4,6 @@ import Tar from '../tar.js'; import SevenZip from './sevenZip.js'; export default class Gzip extends SevenZip { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): SevenZip { return new Gzip(filePath); } @@ -13,7 +12,6 @@ export default class Gzip extends SevenZip { return ['.gz', '.gzip']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Gzip.getExtensions()[0]; } diff --git a/src/types/files/archives/sevenZip/sevenZip.ts b/src/types/files/archives/sevenZip/sevenZip.ts index e14c9d8a2..c6ffbce1e 100644 --- a/src/types/files/archives/sevenZip/sevenZip.ts +++ b/src/types/files/archives/sevenZip/sevenZip.ts @@ -14,7 +14,6 @@ import ArchiveEntry from '../archiveEntry.js'; export default class SevenZip extends Archive { private static readonly LIST_MUTEX = new Mutex(); - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new SevenZip(filePath); } @@ -23,7 +22,6 @@ export default class SevenZip extends Archive { return ['.7z']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return SevenZip.getExtensions()[0]; } diff --git a/src/types/files/archives/sevenZip/z.ts b/src/types/files/archives/sevenZip/z.ts index 9e497adcb..ae656decd 100644 --- a/src/types/files/archives/sevenZip/z.ts +++ b/src/types/files/archives/sevenZip/z.ts @@ -1,7 +1,6 @@ import SevenZip from './sevenZip.js'; export default class Z extends SevenZip { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): SevenZip { return new Z(filePath); } @@ -10,7 +9,6 @@ export default class Z extends SevenZip { return ['.z']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Z.getExtensions()[0]; } diff --git a/src/types/files/archives/sevenZip/zipSpanned.ts b/src/types/files/archives/sevenZip/zipSpanned.ts index bc80d8a24..715f72527 100644 --- a/src/types/files/archives/sevenZip/zipSpanned.ts +++ b/src/types/files/archives/sevenZip/zipSpanned.ts @@ -1,7 +1,6 @@ import SevenZip from './sevenZip.js'; export default class ZipSpanned extends SevenZip { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): SevenZip { return new ZipSpanned(filePath); } @@ -10,7 +9,6 @@ export default class ZipSpanned extends SevenZip { return ['.zip.001', '.z01']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return ZipSpanned.getExtensions()[0]; } diff --git a/src/types/files/archives/sevenZip/zipX.ts b/src/types/files/archives/sevenZip/zipX.ts index 3305d335d..ee1e0a2da 100644 --- a/src/types/files/archives/sevenZip/zipX.ts +++ b/src/types/files/archives/sevenZip/zipX.ts @@ -3,7 +3,6 @@ import path from 'node:path'; import SevenZip from './sevenZip.js'; export default class ZipX extends SevenZip { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): SevenZip { return new ZipX(filePath); } @@ -12,7 +11,6 @@ export default class ZipX extends SevenZip { return ['.zipx', '.zx01']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { for (const ext of ZipX.getExtensions()) { if (this.getFilePath().toLowerCase().endsWith(ext)) { diff --git a/src/types/files/archives/tar.ts b/src/types/files/archives/tar.ts index 80100f0de..8ae15b782 100644 --- a/src/types/files/archives/tar.ts +++ b/src/types/files/archives/tar.ts @@ -11,7 +11,6 @@ import Archive from './archive.js'; import ArchiveEntry from './archiveEntry.js'; export default class Tar extends Archive { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new Tar(filePath); } @@ -86,7 +85,6 @@ export default class Tar extends Archive { strict: true, filter: (_, stat) => { // @ts-expect-error the type is wrong: https://github.com/isaacs/node-tar/issues/357#issuecomment-1416806436 - // eslint-disable-next-line no-param-reassign stat.path = path.basename(extractedFilePath); return true; }, diff --git a/src/types/files/archives/zip.ts b/src/types/files/archives/zip.ts index c0bffe576..5412822da 100644 --- a/src/types/files/archives/zip.ts +++ b/src/types/files/archives/zip.ts @@ -17,7 +17,6 @@ import Archive from './archive.js'; import ArchiveEntry from './archiveEntry.js'; export default class Zip extends Archive { - // eslint-disable-next-line class-methods-use-this protected new(filePath: string): Archive { return new Zip(filePath); } @@ -26,7 +25,6 @@ export default class Zip extends Archive { return ['.zip', '.apk', '.ipa', '.jar', '.pk3']; } - // eslint-disable-next-line class-methods-use-this getExtension(): string { return Zip.getExtensions()[0]; } diff --git a/src/types/outputFactory.ts b/src/types/outputFactory.ts index 42cc02820..b73eee729 100644 --- a/src/types/outputFactory.ts +++ b/src/types/outputFactory.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line max-classes-per-file import path, { ParsedPath } from 'node:path'; import ArrayPoly from '../polyfill/arrayPoly.js'; diff --git a/src/types/patches/ppfPatch.ts b/src/types/patches/ppfPatch.ts index 2f0d68850..4906ae2c5 100644 --- a/src/types/patches/ppfPatch.ts +++ b/src/types/patches/ppfPatch.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line max-classes-per-file import FilePoly from '../../polyfill/filePoly.js'; import fsPoly from '../../polyfill/fsPoly.js'; import ExpectedError from '../expectedError.js'; diff --git a/src/types/patches/vcdiffPatch.ts b/src/types/patches/vcdiffPatch.ts index f3f090366..ad67b2d3c 100644 --- a/src/types/patches/vcdiffPatch.ts +++ b/src/types/patches/vcdiffPatch.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line max-classes-per-file import FilePoly from '../../polyfill/filePoly.js'; import fsPoly from '../../polyfill/fsPoly.js'; import ExpectedError from '../expectedError.js'; @@ -514,7 +513,6 @@ export default class VcdiffPatch extends Patch { for (let i = 0; i <= 1; i += 1) { const instruction = header.codeTable[instructionCodeIdx][i]; if (instruction.type === VcdiffInstruction.NOOP) { - // eslint-disable-next-line no-continue continue; } diff --git a/test/console/progressBarFake.ts b/test/console/progressBarFake.ts index eb5fdbe6c..2481b79c0 100644 --- a/test/console/progressBarFake.ts +++ b/test/console/progressBarFake.ts @@ -1,5 +1,3 @@ -/* eslint-disable class-methods-use-this */ - import ProgressBar from '../../src/console/progressBar.js'; export default class ProgressBarFake extends ProgressBar { diff --git a/test/modules/dats/datMergerSplitter.test.ts b/test/modules/dats/datMergerSplitter.test.ts index 2edde3fb9..4612bf378 100644 --- a/test/modules/dats/datMergerSplitter.test.ts +++ b/test/modules/dats/datMergerSplitter.test.ts @@ -40,7 +40,7 @@ test.each( }); describe('MAME v0.258', () => { - /* eslint-disable object-curly-newline, unicorn/numeric-separators-style */ + /* eslint-disable unicorn/numeric-separators-style */ const dat = new LogiqxDAT(new Header(), [ // ***** Games ***** new Machine({ From d43178191ef9f54128265b9cd96e1abc5b4e221b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 20:08:35 +0000 Subject: [PATCH 6/8] Chore: update thollander/actions-comment-pull-request action to v3 (#1384) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian Emmer <10749361+emmercm@users.noreply.github.com> --- .github/workflows/gh-automerge-disabler.yml | 8 ++++---- .github/workflows/gh-release-drafter.yml | 8 ++++---- .github/workflows/node-branch-exec.yml | 8 ++++---- .github/workflows/node-publish.yml | 8 ++++---- .github/workflows/pr-renamer.yml | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/gh-automerge-disabler.yml b/.github/workflows/gh-automerge-disabler.yml index d846a6176..56738056a 100644 --- a/.github/workflows/gh-automerge-disabler.yml +++ b/.github/workflows/gh-automerge-disabler.yml @@ -26,7 +26,7 @@ jobs: - run: gh pr merge "${{ github.event.pull_request.number }}" --disable-auto env: GH_TOKEN: ${{ github.token }} - - uses: thollander/actions-comment-pull-request@v2 + - uses: thollander/actions-comment-pull-request@v3 with: message: | ## :warning: Disabling auto-merge @@ -34,7 +34,7 @@ jobs: _Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._ mode: recreate - comment_tag: gh-automerge-disabler + comment-tag: gh-automerge-disabler remove-comment: if: ${{ !github.event.pull_request.auto_merge || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} @@ -42,8 +42,8 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: thollander/actions-comment-pull-request@v2 + - uses: thollander/actions-comment-pull-request@v3 with: message: Deleting mode: delete - comment_tag: gh-automerge-disabler + comment-tag: gh-automerge-disabler diff --git a/.github/workflows/gh-release-drafter.yml b/.github/workflows/gh-release-drafter.yml index 61535499d..eb043954b 100644 --- a/.github/workflows/gh-release-drafter.yml +++ b/.github/workflows/gh-release-drafter.yml @@ -27,7 +27,7 @@ jobs: permissions: # actions/checkout@v4 contents: read - # thollander/actions-comment-pull-request@v2 + # thollander/actions-comment-pull-request pull-requests: write runs-on: ubuntu-latest steps: @@ -105,12 +105,12 @@ jobs: | jq --raw-output '.[0].number') echo "PR_NUMBER=${PR_NUMBER}" >> "${GITHUB_OUTPUT}" - if: ${{ steps.release-drafter.outputs.id }} - uses: thollander/actions-comment-pull-request@v2 + uses: thollander/actions-comment-pull-request@v3 with: message: | ## :octocat: GitHub release This pull request resulted in the release: [v${{ steps.check.outputs.version }} @ ${{ env.ref }}](${{ steps.release-drafter.outputs.html_url }}) _Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._ - comment_tag: gh-release - pr_number: ${{ steps.pr-finder.outputs.PR_NUMBER }} + comment-tag: gh-release + pr-number: ${{ steps.pr-finder.outputs.PR_NUMBER }} diff --git a/.github/workflows/node-branch-exec.yml b/.github/workflows/node-branch-exec.yml index d6259cd1f..76bac4538 100644 --- a/.github/workflows/node-branch-exec.yml +++ b/.github/workflows/node-branch-exec.yml @@ -40,7 +40,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: thollander/actions-comment-pull-request@v2 + - uses: thollander/actions-comment-pull-request@v3 with: message: | ## :test_tube: Branch testing instructions @@ -49,7 +49,7 @@ jobs: npm exec --yes -- "github:${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}" [commands..] [options] ``` _Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._ - comment_tag: npm-exec + comment-tag: npm-exec npm-exec-comment-update: if: github.event.action == 'closed' && github.event.pull_request.merged @@ -57,7 +57,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: thollander/actions-comment-pull-request@v2 + - uses: thollander/actions-comment-pull-request@v3 with: message: | ## :test_tube: Branch testing instructions @@ -66,5 +66,5 @@ jobs: npm exec --yes -- "github:${{ github.event.pull_request.base.repo.full_name }}#${{ github.event.pull_request.base.ref }}" [commands..] [options] ``` _Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._ - comment_tag: npm-exec + comment-tag: npm-exec mode: recreate diff --git a/.github/workflows/node-publish.yml b/.github/workflows/node-publish.yml index 9af850d3d..543203dfc 100644 --- a/.github/workflows/node-publish.yml +++ b/.github/workflows/node-publish.yml @@ -16,7 +16,7 @@ jobs: contents: read # `npm publish --provenance` id-token: write - # thollander/actions-comment-pull-request@v2 + # thollander/actions-comment-pull-request pull-requests: write runs-on: ubuntu-latest steps: @@ -51,12 +51,12 @@ jobs: "https://api.github.com/repos/${GITHUB_REPOSITORY}/commits/${GIT_SHA}/pulls" \ | jq --raw-output '.[0].number') echo "PR_NUMBER=${PR_NUMBER}" >> "${GITHUB_OUTPUT}" - - uses: thollander/actions-comment-pull-request@v2 + - uses: thollander/actions-comment-pull-request@v3 with: message: | ## :package: npm publish This pull request resulted in the npm release: [v${{ steps.publish.outputs.PACKAGE_VERSION }}](https://www.npmjs.com/package/${{ steps.publish.outputs.PACKAGE_NAME }}/v/${{ steps.publish.outputs.PACKAGE_VERSION }}) _Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._ - comment_tag: node-publish - pr_number: ${{ steps.pr-finder.outputs.PR_NUMBER }} + comment-tag: node-publish + pr-number: ${{ steps.pr-finder.outputs.PR_NUMBER }} diff --git a/.github/workflows/pr-renamer.yml b/.github/workflows/pr-renamer.yml index 9c2f397b3..df6ff245e 100644 --- a/.github/workflows/pr-renamer.yml +++ b/.github/workflows/pr-renamer.yml @@ -82,7 +82,7 @@ jobs: # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable NEW_TITLE: ${{ steps.title-massager.outputs.NEW_TITLE }} - if: '!cancelled()' - uses: thollander/actions-comment-pull-request@v2 + uses: thollander/actions-comment-pull-request@v3 with: message: | ## :x: Invalid pull request title @@ -92,8 +92,8 @@ jobs: ``` _Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._ mode: ${{ steps.gh-pr-edit.outcome != 'success' && 'upsert' || 'delete' }} - create_if_not_exists: ${{ steps.gh-pr-edit.outcome != 'success' && 'true' || 'false' }} - comment_tag: pr-renamer + create-if-not-exists: ${{ steps.gh-pr-edit.outcome != 'success' && 'true' || 'false' }} + comment-tag: pr-renamer # !!! This check should be required by GitHub !!! title-status-check: From f955be0a7f95a8125c4171a6cfb58728d4a9aa3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:10:23 +0000 Subject: [PATCH 7/8] Chore: update lockfile (#1386) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian Emmer <10749361+emmercm@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3898f0539..a7fe21202 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4786,9 +4786,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.47", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.47.tgz", - "integrity": "sha512-zS5Yer0MOYw4rtK2iq43cJagHZ8sXN0jDHDKzB+86gSBSAI4v07S97mcq+Gs2vclAxSh1j7vOAHxSVgduiiuVQ==", + "version": "1.5.48", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.48.tgz", + "integrity": "sha512-FXULnNK7ACNI9MTMOVAzUGiz/YrK9Kcb0s/JT4aJgsam7Eh6XYe7Y6q95lPq+VdBe1DpT2eTnfXFtnuPGCks4w==", "dev": true, "license": "ISC" }, From 209c17f30e46480572ce5554a5515c9d8cb99ce5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:56:32 +0000 Subject: [PATCH 8/8] Chore: update dependency typescript to v5.7.2 (#1363) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian Emmer <10749361+emmercm@users.noreply.github.com> --- jest.config.ts | 92 ++++++++++++++++++++++++----------------------- package-lock.json | 8 ++--- package.json | 2 +- tsconfig.json | 6 +++- 4 files changed, 57 insertions(+), 51 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index c4912fdaa..f7fc6bb01 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,49 +1,51 @@ import fs from 'node:fs'; import path from 'node:path'; -import { JestConfigWithTsJest } from 'ts-jest'; - -// Fix some bad package.json files that don't play well with ts-jest -[ - // https://github.com/g-plane/cue/issues/1 - '@gplane/cue', -].forEach((moduleName) => { - const modulePath = path.join('node_modules', moduleName); - const packagePath = path.join(modulePath, 'package.json'); - const packageJson = JSON.parse(fs.readFileSync(packagePath).toString()); - - packageJson.main = packageJson.main ?? packageJson.exports['.'].import; - delete packageJson.exports; - - fs.writeFileSync(packagePath, JSON.stringify(packageJson, undefined, 2)); -}); - -const jestConfig: JestConfigWithTsJest = { - preset: 'ts-jest', - testEnvironment: 'node', - - setupFilesAfterEnv: ['jest-extended/all'], - - // Most tests are I/O-bound, increase the test timeout globally - testTimeout: 20_000, - - // BEGIN https://kulshekhar.github.io/ts-jest/docs/guides/esm-support - extensionsToTreatAsEsm: ['.ts'], - transform: { - '^.+\\.tsx?$': ['ts-jest', { useESM: true }], - }, - moduleNameMapper: { - '^(\\.{1,2}/.*)\\.js$': '$1', - // END https://kulshekhar.github.io/ts-jest/docs/guides/esm-support - }, - - // Don't run any compiled versions of the tests, if they exist - modulePathIgnorePatterns: ['/dist/'], - // Don't report coverage on the test directory - coveragePathIgnorePatterns: ['/test/'], - - // Report coverage on all source files, because it won't by default... - collectCoverageFrom: ['/src/**/*.{js,cjs,mjs,ts}'], +import type { Config } from 'jest'; + +export default async (): Promise => { + // Fix some bad package.json files that don't play well with ts-jest + await Promise.all( + [ + // https://github.com/g-plane/cue/issues/1 + '@gplane/cue', + ].map(async (moduleName) => { + const modulePath = path.join('node_modules', moduleName); + const packagePath = path.join(modulePath, 'package.json'); + const packageJson = JSON.parse((await fs.promises.readFile(packagePath)).toString()); + + packageJson.main = packageJson.main ?? packageJson.exports['.'].import; + delete packageJson.exports; + + await fs.promises.writeFile(packagePath, JSON.stringify(packageJson, undefined, 2)); + }), + ); + + return { + preset: 'ts-jest', + testEnvironment: 'node', + + setupFilesAfterEnv: ['jest-extended/all'], + + // Most tests are I/O-bound, increase the test timeout globally + testTimeout: 20_000, + + // BEGIN https://kulshekhar.github.io/ts-jest/docs/guides/esm-support + extensionsToTreatAsEsm: ['.ts'], + transform: { + '^.+\\.tsx?$': ['ts-jest', { useESM: true }], + }, + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + // END https://kulshekhar.github.io/ts-jest/docs/guides/esm-support + }, + + // Don't run any compiled versions of the tests, if they exist + modulePathIgnorePatterns: ['/dist/'], + // Don't report coverage on the test directory + coveragePathIgnorePatterns: ['/test/'], + + // Report coverage on all source files, because it won't by default... + collectCoverageFrom: ['/src/**/*.{js,cjs,mjs,ts}'], + }; }; - -export default jestConfig; diff --git a/package-lock.json b/package-lock.json index a7fe21202..244bdb9cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -83,7 +83,7 @@ "prettier": "3.4.2", "ts-jest": "29.2.5", "ts-node": "10.9.2", - "typescript": "5.5.4", + "typescript": "5.7.2", "which": "5.0.0" }, "engines": { @@ -11313,9 +11313,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 659a59ed2..01afe1036 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "prettier": "3.4.2", "ts-jest": "29.2.5", "ts-node": "10.9.2", - "typescript": "5.5.4", + "typescript": "5.7.2", "which": "5.0.0" }, "//engines": [ diff --git a/tsconfig.json b/tsconfig.json index 39a3f7111..dd7fb5f36 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,7 +27,7 @@ /* Modules */ "module": "node16", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node16", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "moduleResolution": "node16", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ @@ -103,5 +103,9 @@ "ts-node": { "esm": true, "experimentalSpecifierResolution": "node", + // Fix typescript@>=5.6.0 breaking ts-node@10.9.2 + // WARN: this will skip type checking! + // https://github.com/nodejs/node/issues/48207#issuecomment-1880644283 + "transpileOnly": true } }