From d00968a7e06871e6dddb3523af353fc4afa9bc93 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Tue, 24 Sep 2024 15:30:09 -0400 Subject: [PATCH] stash --- eslint.config.mjs | 58 +++++++----- package.json | 6 +- yarn.lock | 233 ++++++++++++++++++++++++++++------------------ 3 files changed, 179 insertions(+), 118 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index ef33c45e59..b0cb770956 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -67,13 +67,44 @@ const config = tseslint.config({ }, { files: ['*.test.{ts,js}', '**/tests/**/*.{ts,js}'], - extends: jest, + extends: [...jest, ...typescript], + languageOptions: { + sourceType: 'module', + }, +}, +{ + files: ['*.d.ts'], + rules: { + '@typescript-eslint/naming-convention': 'warn', + 'import/unambiguous': 'off', + }, +}, +{ + files: ['scripts/*.ts'], + extends: nodejs, + languageOptions: { + sourceType: 'module', + parserOptions: { + project: ['./scripts/*/tsconfig.json'], + }, + }, + rules: { + // All scripts will have shebangs. + 'n/shebang': 'off', + }, }, { // These files are test helpers, not tests. We still use the Jest ESLint // config here to ensure that ESLint expects a test-like environment, but // various rules meant just to apply to tests have been disabled. files: ['**/tests/**/*.{ts,js}', '!*.test.{ts,js}'], + languageOptions: { + sourceType: 'module', + parserOptions: { + tsconfigRootDir: import.meta.dirname, + project: ['./packages/*/tsconfig.json'], + }, + }, rules: { 'jest/no-export': 'off', 'jest/require-top-level-describe': 'off', @@ -85,7 +116,7 @@ const config = tseslint.config({ languageOptions: { parserOptions: { sourceType: 'script', - ecmaVersion: '2020', + ecmaVersion: 2020, }, }, }, @@ -93,8 +124,8 @@ const config = tseslint.config({ files: ['*.ts'], extends: typescript, languageOptions: { + sourceType: 'module', parserOptions: { - sourceType: 'module', tsconfigRootDir: import.meta.dirname, project: ['./packages/*/tsconfig.json'], }, @@ -119,32 +150,11 @@ const config = tseslint.config({ }, { files: ['tests/setupAfterEnv/matchers.ts'], - languageOptions: { - parserOptions: { - sourceType: 'script', - }, - }, -}, -{ - files: ['*.d.ts'], - rules: { - '@typescript-eslint/naming-convention': 'warn', - 'import/unambiguous': 'off', - }, -}, -{ - files: ['scripts/*.ts'], - extends: nodejs, languageOptions: { parserOptions: { sourceType: 'module', - project: ['./scripts/*/tsconfig.json'], }, }, - rules: { - // All scripts will have shebangs. - 'n/shebang': 'off', - }, }, { files: ['**/jest.environment.js'], diff --git a/package.json b/package.json index 6a1449d9dd..9e38f85aba 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,10 @@ "@types/lodash": "^4.14.191", "@types/node": "^16.18.54", "@types/semver": "^7", - "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", + "@typescript-eslint/eslint-plugin": "^8.7.0", + "@typescript-eslint/parser": "^8.7.0", "@yarnpkg/types": "^4.0.0", - "babel-jest": "^27.5.1", + "babel-jest": "^29.7.0", "depcheck": "^1.4.7", "eslint": "^9.11.0", "eslint-config-prettier": "^9.1.0", diff --git a/yarn.lock b/yarn.lock index 16df2ef028..d5da5c2444 100644 --- a/yarn.lock +++ b/yarn.lock @@ -48,7 +48,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.5, @babel/core@npm:^7.7.2, @babel/core@npm:^7.8.0": +"@babel/core@npm:^7.1.0, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.5, @babel/core@npm:^7.7.2, @babel/core@npm:^7.8.0": version: 7.25.2 resolution: "@babel/core@npm:7.25.2" dependencies: @@ -614,7 +614,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.6.1": version: 4.11.0 resolution: "@eslint-community/regexpp@npm:4.11.0" checksum: 10/f053f371c281ba173fe6ee16dbc4fe544c84870d58035ccca08dba7f6ce1830d895ce3237a0db89ba37616524775dca82f1c502066b58e2d5712d7f87f5ba17c @@ -1904,6 +1904,29 @@ __metadata: languageName: node linkType: hard +"@jest/transform@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/transform@npm:29.7.0" + dependencies: + "@babel/core": "npm:^7.11.6" + "@jest/types": "npm:^29.6.3" + "@jridgewell/trace-mapping": "npm:^0.3.18" + babel-plugin-istanbul: "npm:^6.1.1" + chalk: "npm:^4.0.0" + convert-source-map: "npm:^2.0.0" + fast-json-stable-stringify: "npm:^2.1.0" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^29.7.0" + jest-regex-util: "npm:^29.6.3" + jest-util: "npm:^29.7.0" + micromatch: "npm:^4.0.4" + pirates: "npm:^4.0.4" + slash: "npm:^3.0.0" + write-file-atomic: "npm:^4.0.2" + checksum: 10/30f42293545ab037d5799c81d3e12515790bb58513d37f788ce32d53326d0d72ebf5b40f989e6896739aa50a5f77be44686e510966370d58511d5ad2637c68c1 + languageName: node + linkType: hard + "@jest/types@npm:^26.6.2": version: 26.6.2 resolution: "@jest/types@npm:26.6.2" @@ -1986,7 +2009,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": +"@jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -2446,10 +2469,10 @@ __metadata: "@types/lodash": "npm:^4.14.191" "@types/node": "npm:^16.18.54" "@types/semver": "npm:^7" - "@typescript-eslint/eslint-plugin": "npm:^5.62.0" - "@typescript-eslint/parser": "npm:^5.62.0" + "@typescript-eslint/eslint-plugin": "npm:^8.7.0" + "@typescript-eslint/parser": "npm:^8.7.0" "@yarnpkg/types": "npm:^4.0.0" - babel-jest: "npm:^27.5.1" + babel-jest: "npm:^29.7.0" depcheck: "npm:^1.4.7" eslint: "npm:^9.11.0" eslint-config-prettier: "npm:^9.1.0" @@ -4396,7 +4419,7 @@ __metadata: languageName: node linkType: hard -"@types/graceful-fs@npm:^4.1.2": +"@types/graceful-fs@npm:^4.1.2, @types/graceful-fs@npm:^4.1.3": version: 4.1.9 resolution: "@types/graceful-fs@npm:4.1.9" dependencies: @@ -4637,7 +4660,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:8.7.0": +"@typescript-eslint/eslint-plugin@npm:8.7.0, @typescript-eslint/eslint-plugin@npm:^8.7.0": version: 8.7.0 resolution: "@typescript-eslint/eslint-plugin@npm:8.7.0" dependencies: @@ -4660,31 +4683,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.62.0" - dependencies: - "@eslint-community/regexpp": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:5.62.0" - "@typescript-eslint/type-utils": "npm:5.62.0" - "@typescript-eslint/utils": "npm:5.62.0" - debug: "npm:^4.3.4" - graphemer: "npm:^1.4.0" - ignore: "npm:^5.2.0" - natural-compare-lite: "npm:^1.4.0" - semver: "npm:^7.3.7" - tsutils: "npm:^3.21.0" - peerDependencies: - "@typescript-eslint/parser": ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 10/9cc8319c6fd8a21938f5b69476974a7e778c283a55ef9fad183c850995b9adcb0087d57cea7b2ac6b9449570eee983aad39491d14cdd2e52d6b4b0485e7b2482 - languageName: node - linkType: hard - -"@typescript-eslint/parser@npm:8.7.0": +"@typescript-eslint/parser@npm:8.7.0, @typescript-eslint/parser@npm:^8.7.0": version: 8.7.0 resolution: "@typescript-eslint/parser@npm:8.7.0" dependencies: @@ -4702,23 +4701,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/parser@npm:5.62.0" - dependencies: - "@typescript-eslint/scope-manager": "npm:5.62.0" - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/typescript-estree": "npm:5.62.0" - debug: "npm:^4.3.4" - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 10/b6ca629d8f4e6283ff124501731cc886703eb4ce2c7d38b3e4110322ea21452b9d9392faf25be6bd72f54b89de7ffc72a40d9b159083ac54345a3d04b4fa5394 - languageName: node - linkType: hard - "@typescript-eslint/scope-manager@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/scope-manager@npm:5.62.0" @@ -4739,23 +4721,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/type-utils@npm:5.62.0" - dependencies: - "@typescript-eslint/typescript-estree": "npm:5.62.0" - "@typescript-eslint/utils": "npm:5.62.0" - debug: "npm:^4.3.4" - tsutils: "npm:^3.21.0" - peerDependencies: - eslint: "*" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10/f9a4398d6d2aae09e3e765eff04cf4ab364376a87868031ac5c6a64c9bbb555cb1a7f99b07b3d1017e7422725b5f0bbee537f13b82ab2d930f161c987b3dece0 - languageName: node - linkType: hard - "@typescript-eslint/type-utils@npm:8.7.0": version: 8.7.0 resolution: "@typescript-eslint/type-utils@npm:8.7.0" @@ -4822,7 +4787,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.62.0, @typescript-eslint/utils@npm:^5.10.0": +"@typescript-eslint/utils@npm:8.7.0, @typescript-eslint/utils@npm:^8.1.0": + version: 8.7.0 + resolution: "@typescript-eslint/utils@npm:8.7.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:8.7.0" + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/typescript-estree": "npm:8.7.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + checksum: 10/81674503fb5ea32ff5de8f1a29fecbcfa947025e7609e861ac8e32cd13326fc050c4fa5044e1a877f05e7e1264c42b9c72a7fd09c4a41d0ac2cf1c49259abf03 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:^5.10.0": version: 5.62.0 resolution: "@typescript-eslint/utils@npm:5.62.0" dependencies: @@ -4840,20 +4819,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.7.0, @typescript-eslint/utils@npm:^8.1.0": - version: 8.7.0 - resolution: "@typescript-eslint/utils@npm:8.7.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.7.0" - "@typescript-eslint/types": "npm:8.7.0" - "@typescript-eslint/typescript-estree": "npm:8.7.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - checksum: 10/81674503fb5ea32ff5de8f1a29fecbcfa947025e7609e861ac8e32cd13326fc050c4fa5044e1a877f05e7e1264c42b9c72a7fd09c4a41d0ac2cf1c49259abf03 - languageName: node - linkType: hard - "@typescript-eslint/visitor-keys@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" @@ -5348,6 +5313,23 @@ __metadata: languageName: node linkType: hard +"babel-jest@npm:^29.7.0": + version: 29.7.0 + resolution: "babel-jest@npm:29.7.0" + dependencies: + "@jest/transform": "npm:^29.7.0" + "@types/babel__core": "npm:^7.1.14" + babel-plugin-istanbul: "npm:^6.1.1" + babel-preset-jest: "npm:^29.6.3" + chalk: "npm:^4.0.0" + graceful-fs: "npm:^4.2.9" + slash: "npm:^3.0.0" + peerDependencies: + "@babel/core": ^7.8.0 + checksum: 10/8a0953bd813b3a8926008f7351611055548869e9a53dd36d6e7e96679001f71e65fd7dbfe253265c3ba6a4e630dc7c845cf3e78b17d758ef1880313ce8fba258 + languageName: node + linkType: hard + "babel-plugin-istanbul@npm:^6.1.1": version: 6.1.1 resolution: "babel-plugin-istanbul@npm:6.1.1" @@ -5373,6 +5355,18 @@ __metadata: languageName: node linkType: hard +"babel-plugin-jest-hoist@npm:^29.6.3": + version: 29.6.3 + resolution: "babel-plugin-jest-hoist@npm:29.6.3" + dependencies: + "@babel/template": "npm:^7.3.3" + "@babel/types": "npm:^7.3.3" + "@types/babel__core": "npm:^7.1.14" + "@types/babel__traverse": "npm:^7.0.6" + checksum: 10/9bfa86ec4170bd805ab8ca5001ae50d8afcb30554d236ba4a7ffc156c1a92452e220e4acbd98daefc12bf0216fccd092d0a2efed49e7e384ec59e0597a926d65 + languageName: node + linkType: hard + "babel-preset-current-node-syntax@npm:^1.0.0": version: 1.1.0 resolution: "babel-preset-current-node-syntax@npm:1.1.0" @@ -5410,6 +5404,18 @@ __metadata: languageName: node linkType: hard +"babel-preset-jest@npm:^29.6.3": + version: 29.6.3 + resolution: "babel-preset-jest@npm:29.6.3" + dependencies: + babel-plugin-jest-hoist: "npm:^29.6.3" + babel-preset-current-node-syntax: "npm:^1.0.0" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/aa4ff2a8a728d9d698ed521e3461a109a1e66202b13d3494e41eea30729a5e7cc03b3a2d56c594423a135429c37bf63a9fa8b0b9ce275298be3095a88c69f6fb + languageName: node + linkType: hard + "babel-runtime@npm:^6.26.0": version: 6.26.0 resolution: "babel-runtime@npm:6.26.0" @@ -8808,6 +8814,29 @@ __metadata: languageName: node linkType: hard +"jest-haste-map@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-haste-map@npm:29.7.0" + dependencies: + "@jest/types": "npm:^29.6.3" + "@types/graceful-fs": "npm:^4.1.3" + "@types/node": "npm:*" + anymatch: "npm:^3.0.3" + fb-watchman: "npm:^2.0.0" + fsevents: "npm:^2.3.2" + graceful-fs: "npm:^4.2.9" + jest-regex-util: "npm:^29.6.3" + jest-util: "npm:^29.7.0" + jest-worker: "npm:^29.7.0" + micromatch: "npm:^4.0.4" + walker: "npm:^1.0.8" + dependenciesMeta: + fsevents: + optional: true + checksum: 10/8531b42003581cb18a69a2774e68c456fb5a5c3280b1b9b77475af9e346b6a457250f9d756bfeeae2fe6cbc9ef28434c205edab9390ee970a919baddfa08bb85 + languageName: node + linkType: hard + "jest-it-up@npm:^2.0.2": version: 2.2.0 resolution: "jest-it-up@npm:2.2.0" @@ -8943,6 +8972,13 @@ __metadata: languageName: node linkType: hard +"jest-regex-util@npm:^29.6.3": + version: 29.6.3 + resolution: "jest-regex-util@npm:29.6.3" + checksum: 10/0518beeb9bf1228261695e54f0feaad3606df26a19764bc19541e0fc6e2a3737191904607fb72f3f2ce85d9c16b28df79b7b1ec9443aa08c3ef0e9efda6f8f2a + languageName: node + linkType: hard + "jest-resolve-dependencies@npm:^27.5.1": version: 27.5.1 resolution: "jest-resolve-dependencies@npm:27.5.1" @@ -9172,6 +9208,18 @@ __metadata: languageName: node linkType: hard +"jest-worker@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-worker@npm:29.7.0" + dependencies: + "@types/node": "npm:*" + jest-util: "npm:^29.7.0" + merge-stream: "npm:^2.0.0" + supports-color: "npm:^8.0.0" + checksum: 10/364cbaef00d8a2729fc760227ad34b5e60829e0869bd84976bdfbd8c0d0f9c2f22677b3e6dd8afa76ed174765351cd12bae3d4530c62eefb3791055127ca9745 + languageName: node + linkType: hard + "jest@npm:^27.5.1": version: 27.5.1 resolution: "jest@npm:27.5.1" @@ -9937,13 +9985,6 @@ __metadata: languageName: node linkType: hard -"natural-compare-lite@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare-lite@npm:1.4.0" - checksum: 10/5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 - languageName: node - linkType: hard - "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -11215,7 +11256,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3": +"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: 10/a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 @@ -12262,7 +12303,7 @@ __metadata: languageName: node linkType: hard -"walker@npm:^1.0.7": +"walker@npm:^1.0.7, walker@npm:^1.0.8": version: 1.0.8 resolution: "walker@npm:1.0.8" dependencies: @@ -12500,6 +12541,16 @@ __metadata: languageName: node linkType: hard +"write-file-atomic@npm:^4.0.2": + version: 4.0.2 + resolution: "write-file-atomic@npm:4.0.2" + dependencies: + imurmurhash: "npm:^0.1.4" + signal-exit: "npm:^3.0.7" + checksum: 10/3be1f5508a46c190619d5386b1ac8f3af3dbe951ed0f7b0b4a0961eed6fc626bd84b50cf4be768dabc0a05b672f5d0c5ee7f42daa557b14415d18c3a13c7d246 + languageName: node + linkType: hard + "write-file-atomic@npm:^5.0.0": version: 5.0.1 resolution: "write-file-atomic@npm:5.0.1"