diff --git a/.github/renovate.json b/.github/renovate.json index 0967deb13..49b7c0b06 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,5 +1,5 @@ { - "extends": ["config:recommended"], + "extends": ["config:recommended", "helpers:disableTypesNodeMajor"], "lockFileMaintenance": { "enabled": true, "automerge": true diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 222b2f8ff..20bf68d8d 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -72,25 +72,9 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16.x, 18.x, 20.x, 21.x, 22.x, 23.x, 24.x] - eslint-version: [7, 8, 9] - ts-eslint-plugin-version: [6, 7, 8] - exclude: - # ts-eslint/plugin@7 doesn't support node@16 - - node-version: 16.x - ts-eslint-plugin-version: 7 - # ts-eslint/plugin@8 doesn't support node@16 - - node-version: 16.x - ts-eslint-plugin-version: 8 - # eslint@9 doesn't support node@16 - - node-version: 16.x - eslint-version: 9 - # ts-eslint/plugin@7 doesn't support eslint@7 - - eslint-version: 7 - ts-eslint-plugin-version: 7 - # ts-eslint/plugin@8 doesn't support eslint@7 - - eslint-version: 7 - ts-eslint-plugin-version: 8 + node-version: [20.x, 22.x, 24.x] + eslint-version: [8, 9] + ts-eslint-plugin-version: [8] runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a0a9c11..933e9dc91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +# [29.0.0](https://github.com/jest-community/eslint-plugin-jest/compare/v28.14.0...v29.0.0) (2025-06-18) + + +### Bug Fixes + +* remove `jest/no-alias-methods` from `styles` config ([d3bf1dc](https://github.com/jest-community/eslint-plugin-jest/commit/d3bf1dcec9322304a37fe45e6a5cdeee7775c543)) + + +### Features + +* drop support for `[@typescript-eslint](https://github.com/typescript-eslint)` v6 ([fe61a40](https://github.com/jest-community/eslint-plugin-jest/commit/fe61a409d41ef4e7ab8137b8b3d3f66cee6d40a6)) +* drop support for `[@typescript-eslint](https://github.com/typescript-eslint)` v7 ([5ca65d3](https://github.com/jest-community/eslint-plugin-jest/commit/5ca65d3f941e5c0684876c20f251e2d467fc5a15)) +* drop support for ESLint v7 ([b06e7d0](https://github.com/jest-community/eslint-plugin-jest/commit/b06e7d000fd730c24c7eb7a21d34e5cf92b30835)) +* drop support for ESLint v8.x prior to v8.57.0 ([d79765a](https://github.com/jest-community/eslint-plugin-jest/commit/d79765af01e67db6646d3416cbf26df6bab414e7)) +* drop support for Node v16 ([aaf62cd](https://github.com/jest-community/eslint-plugin-jest/commit/aaf62cd0da1ada072101d4d84b6a66a35d82425c)) +* drop support for Node v18 ([598880c](https://github.com/jest-community/eslint-plugin-jest/commit/598880c4cb26eed177d1efdf3f8d4293956b58ac)) +* drop support for Node v20.x prior to v20.12.0 ([2f2fb68](https://github.com/jest-community/eslint-plugin-jest/commit/2f2fb68db315388230fe5bcefbcafcc2716e07e4)) +* drop support for Node v21 ([a366393](https://github.com/jest-community/eslint-plugin-jest/commit/a366393fb38a55c91d0200791315e727fcfe3e90)) +* drop support for Node v23 ([1fb1a67](https://github.com/jest-community/eslint-plugin-jest/commit/1fb1a6747ed0f15ce4532624715c2b2a079e18f2)) +* **unbound-method:** remove `docs.recommended` and `docs.requiresTypeChecking` properties ([945651c](https://github.com/jest-community/eslint-plugin-jest/commit/945651c36c471f424b743f0aae3ccca6271f21ba)) + + +### BREAKING CHANGES + +* dropped support for ESLint v8.x prior to v8.57.0 +* dropped support for Node v20.x prior to v20.12.0 +* dropped support for Node v23 +* dropped support for Node v18 +* **unbound-method:** removed `docs.recommend` and `docs.requiresTypeChecking` from `unbound-method` +* dropped support for `@typescript-eslint` v7 +* dropped support for `@typescript-eslint` v6 +* `jest/no-alias-methods` has been removed from the `styles` config as its already in + the `recommended` config +* dropped support for ESLint v7 +* dropped support for Node v21 +* dropped support for Node v16 + # [28.14.0](https://github.com/jest-community/eslint-plugin-jest/compare/v28.13.5...v28.14.0) (2025-06-15) diff --git a/README.md b/README.md index 7687b1cb3..79064c319 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ Manually fixable by | [expect-expect](docs/rules/expect-expect.md) | Enforce assertion to be made in a test body | | ✅ | | | | [max-expects](docs/rules/max-expects.md) | Enforces a maximum number assertion calls in a test body | | | | | | [max-nested-describe](docs/rules/max-nested-describe.md) | Enforces a maximum depth to nested describe calls | | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | Disallow alias methods | ✅ | 🎨 | 🔧 | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | Disallow alias methods | ✅ | | 🔧 | | | [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | Disallow commented out tests | | ✅ | | | | [no-conditional-expect](docs/rules/no-conditional-expect.md) | Disallow calling `expect` conditionally | ✅ | | | | | [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | Disallow conditional logic in tests | | | | | diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index d69777b76..6796de373 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,8 +1,6 @@ # Disallow alias methods (`no-alias-methods`) -💼⚠️ This rule is enabled in the ✅ `recommended` -[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations). -This rule _warns_ in the 🎨 `style` +💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations). 🔧 This rule is automatically fixable by the @@ -10,7 +8,7 @@ This rule _warns_ in the 🎨 `style` -> These aliases are going to be removed in the next major version of Jest - see +> These aliases have been removed in Jest v30 - see > for more Several Jest methods have alias names, such as `toThrow` having the alias of diff --git a/docs/rules/no-deprecated-functions.md b/docs/rules/no-deprecated-functions.md index cd6549327..965f38350 100644 --- a/docs/rules/no-deprecated-functions.md +++ b/docs/rules/no-deprecated-functions.md @@ -53,5 +53,5 @@ Jest 27. ### `jest.genMockFromModule` -This function was renamed to `createMockFromModule` in Jest 26, and is scheduled -for removal in Jest 30. +This function was renamed to `createMockFromModule` in Jest 26, and removed in +Jest 30. diff --git a/package.json b/package.json index 41f43150d..ee3eff794 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-jest", - "version": "28.14.0", + "version": "29.0.0", "description": "ESLint rules for Jest", "keywords": [ "eslint", @@ -67,7 +67,7 @@ ] }, "dependencies": { - "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/utils": "^8.0.0" }, "devDependencies": { "@babel/cli": "^7.4.4", @@ -80,10 +80,10 @@ "@schemastore/package": "^0.0.10", "@semantic-release/changelog": "^6.0.0", "@semantic-release/git": "^10.0.0", - "@tsconfig/node16": "^16.0.0", + "@tsconfig/node20": "^20.0.0", "@types/eslint": "^8.4.6", "@types/jest": "^29.0.0", - "@types/node": "^16.0.0", + "@types/node": "^20.0.0", "@types/semver": "^7.5.8", "@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/parser": "^8.0.0", @@ -91,7 +91,7 @@ "babel-jest": "^29.0.0", "babel-plugin-replace-ts-export-assignment": "^0.0.2", "dedent": "^1.5.0", - "eslint": "^7.0.0 || ^8.0.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^10.0.0", "eslint-doc-generator": "^2.0.0", "eslint-plugin-eslint-plugin": "^6.0.0", @@ -111,13 +111,12 @@ "rimraf": "^5.0.0", "semantic-release": "^24.0.0", "semver": "^7.3.5", - "strip-ansi": "^6.0.0", "ts-node": "^10.2.1", "typescript": "^5.0.4" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", - "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", + "@typescript-eslint/eslint-plugin": "^8.0.0", + "eslint": "^8.57.0 || ^9.0.0", "jest": "*" }, "peerDependenciesMeta": { @@ -130,7 +129,7 @@ }, "packageManager": "yarn@3.8.7", "engines": { - "node": "^16.10.0 || ^18.12.0 || >=20.0.0" + "node": "^20.12.0 || ^22.0.0 || >=24.0.0" }, "publishConfig": { "provenance": true diff --git a/src/__tests__/__snapshots__/rules.test.ts.snap b/src/__tests__/__snapshots__/rules.test.ts.snap index 06883704c..9e436ad59 100644 --- a/src/__tests__/__snapshots__/rules.test.ts.snap +++ b/src/__tests__/__snapshots__/rules.test.ts.snap @@ -242,7 +242,6 @@ exports[`rules should export configs that refer to actual rules 1`] = ` }, }, "rules": { - "jest/no-alias-methods": "warn", "jest/prefer-to-be": "error", "jest/prefer-to-contain": "error", "jest/prefer-to-have-length": "error", @@ -285,7 +284,6 @@ exports[`rules should export configs that refer to actual rules 1`] = ` "jest", ], "rules": { - "jest/no-alias-methods": "warn", "jest/prefer-to-be": "error", "jest/prefer-to-contain": "error", "jest/prefer-to-have-length": "error", diff --git a/src/index.ts b/src/index.ts index 52b142983..e32f97b52 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,7 +53,6 @@ const recommendedRules = { } satisfies Record; const styleRules = { - 'jest/no-alias-methods': 'warn', 'jest/prefer-to-be': 'error', 'jest/prefer-to-contain': 'error', 'jest/prefer-to-have-length': 'error', diff --git a/src/rules/__tests__/test-utils.ts b/src/rules/__tests__/test-utils.ts index e4fe80132..2acaeb51c 100644 --- a/src/rules/__tests__/test-utils.ts +++ b/src/rules/__tests__/test-utils.ts @@ -8,8 +8,7 @@ const eslintRequire = createRequire(require.resolve('eslint')); export const espreeParser = eslintRequire.resolve('espree'); -export const eslintMajorVersion = semver.major(eslintVersion); -export const usingFlatConfig = eslintMajorVersion >= 9; +export const usingFlatConfig = semver.major(eslintVersion) >= 9; export class FlatCompatRuleTester extends TSESLint.RuleTester { public constructor(testerConfig?: TSESLint.RuleTesterConfig) { @@ -25,49 +24,11 @@ export class FlatCompatRuleTester extends TSESLint.RuleTester { tests: TSESLint.RunTests, ) { super.run(ruleName, rule, { - valid: FlatCompatRuleTester._filterCases( - tests.valid.map(t => FlatCompatRuleTester._flatCompat(t)), - ), - invalid: FlatCompatRuleTester._filterCases( - tests.invalid.map(t => FlatCompatRuleTester._flatCompat(t)), - ), + valid: tests.valid.map(t => FlatCompatRuleTester._flatCompat(t)), + invalid: tests.invalid.map(t => FlatCompatRuleTester._flatCompat(t)), }); } - /* istanbul ignore next */ - /** - * Filters out test cases that are using ecma version 2022 or higher when running - * on ESLint v7 - * @private - */ - private static _filterCases< - T extends - | string - | TSESLint.ValidTestCase - | TSESLint.InvalidTestCase, - >(tests: T[]): T[] { - if (semver.major(eslintVersion) > 7) { - return tests; - } - - const filtered = tests.filter( - t => - typeof t === 'string' || - !t.parserOptions?.ecmaVersion || - t.parserOptions.ecmaVersion === 'latest' || - t.parserOptions.ecmaVersion < 2022, - ); - - // print the number of tests that were filtered - if (filtered.length !== tests.length) { - console.warn( - `Filtered ${tests.length - filtered.length} tests due to unsupported parser options.`, - ); - } - - return filtered; - } - /* istanbul ignore next */ private static _flatCompat< T extends diff --git a/src/rules/expect-expect.ts b/src/rules/expect-expect.ts index 73f097889..94145bfc2 100644 --- a/src/rules/expect-expect.ts +++ b/src/rules/expect-expect.ts @@ -6,8 +6,6 @@ import { AST_NODE_TYPES, type TSESTree } from '@typescript-eslint/utils'; import { createRule, - getAncestors, - getDeclaredVariables, getNodeName, getTestCallExpressionsFromDeclaredVariables, isSupportedAccessor, @@ -94,7 +92,8 @@ export default createRule< : -1; if (node.type === AST_NODE_TYPES.FunctionDeclaration) { - const declaredVariables = getDeclaredVariables(context, node); + const declaredVariables = + context.sourceCode.getDeclaredVariables(node); const testCallExpressions = getTestCallExpressionsFromDeclaredVariables( declaredVariables, @@ -129,7 +128,7 @@ export default createRule< unchecked.push(node); } else if (matchesAssertFunctionName(name, assertFunctionNames)) { // Return early in case of nested `it` statements. - checkCallExpressionUsed(getAncestors(context, node)); + checkCallExpressionUsed(context.sourceCode.getAncestors(node)); } }, 'Program:exit'() { diff --git a/src/rules/no-commented-out-tests.ts b/src/rules/no-commented-out-tests.ts index 5b8cd9a50..39428ac72 100644 --- a/src/rules/no-commented-out-tests.ts +++ b/src/rules/no-commented-out-tests.ts @@ -1,5 +1,5 @@ import type { TSESTree } from '@typescript-eslint/utils'; -import { createRule, getSourceCode } from './utils'; +import { createRule } from './utils'; function hasTests(node: TSESTree.Comment) { return /^\s*[xf]?(test|it|describe)(\.\w+|\[['"]\w+['"]\])?\s*\(/mu.test( @@ -21,7 +21,7 @@ export default createRule({ }, defaultOptions: [], create(context) { - const sourceCode = getSourceCode(context); + const { sourceCode } = context; function checkNode(node: TSESTree.Comment) { if (!hasTests(node)) { diff --git a/src/rules/no-conditional-expect.ts b/src/rules/no-conditional-expect.ts index 31e7d3ada..0281467d3 100644 --- a/src/rules/no-conditional-expect.ts +++ b/src/rules/no-conditional-expect.ts @@ -2,7 +2,6 @@ import { AST_NODE_TYPES, type TSESTree } from '@typescript-eslint/utils'; import { type KnownCallExpression, createRule, - getDeclaredVariables, getTestCallExpressionsFromDeclaredVariables, isSupportedAccessor, isTypeOfJestFnCall, @@ -38,7 +37,7 @@ export default createRule({ return { FunctionDeclaration(node) { - const declaredVariables = getDeclaredVariables(context, node); + const declaredVariables = context.sourceCode.getDeclaredVariables(node); const testCallExpressions = getTestCallExpressionsFromDeclaredVariables( declaredVariables, context, diff --git a/src/rules/no-confusing-set-timeout.ts b/src/rules/no-confusing-set-timeout.ts index f295a36fb..e67d1721f 100644 --- a/src/rules/no-confusing-set-timeout.ts +++ b/src/rules/no-confusing-set-timeout.ts @@ -1,7 +1,6 @@ import { type ParsedJestFnCall, createRule, - getScope, isIdentifier, parseJestFnCall, } from './utils'; @@ -49,7 +48,9 @@ export default createRule({ return; } - if (!['global', 'module'].includes(getScope(context, node).type)) { + if ( + !['global', 'module'].includes(context.sourceCode.getScope(node).type) + ) { context.report({ messageId: 'globalSetTimeout', node }); } diff --git a/src/rules/no-disabled-tests.ts b/src/rules/no-disabled-tests.ts index cfce626b0..093db7812 100644 --- a/src/rules/no-disabled-tests.ts +++ b/src/rules/no-disabled-tests.ts @@ -1,7 +1,6 @@ import { createRule, getAccessorValue, - getScope, parseJestFnCall, resolveScope, } from './utils'; @@ -50,7 +49,7 @@ export default createRule({ } }, 'CallExpression[callee.name="pending"]'(node) { - if (resolveScope(getScope(context, node), 'pending')) { + if (resolveScope(context.sourceCode.getScope(node), 'pending')) { return; } diff --git a/src/rules/no-done-callback.ts b/src/rules/no-done-callback.ts index c7a43d34e..0806eaafe 100644 --- a/src/rules/no-done-callback.ts +++ b/src/rules/no-done-callback.ts @@ -3,14 +3,7 @@ import { type TSESLint, type TSESTree, } from '@typescript-eslint/utils'; -import { - createRule, - getFilename, - getNodeName, - getSourceCode, - isFunction, - parseJestFnCall, -} from './utils'; +import { createRule, getNodeName, isFunction, parseJestFnCall } from './utils'; const findCallbackArg = ( node: TSESTree.CallExpression, @@ -109,7 +102,7 @@ export default createRule({ fix(fixer) { const { body, params } = callback; - const sourceCode = getSourceCode(context); + const { sourceCode } = context; const firstBodyToken = sourceCode.getFirstToken(body); const lastBodyToken = sourceCode.getLastToken(body); @@ -133,7 +126,7 @@ export default createRule({ !tokenAfterLastParam ) { throw new Error( - `Unexpected null when attempting to fix ${getFilename(context)} - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`, + `Unexpected null when attempting to fix ${context.filename} - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`, ); } diff --git a/src/rules/no-jasmine-globals.ts b/src/rules/no-jasmine-globals.ts index 6d0d122dd..59be150d4 100644 --- a/src/rules/no-jasmine-globals.ts +++ b/src/rules/no-jasmine-globals.ts @@ -2,7 +2,6 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { createRule, getNodeName, - getScope, isSupportedAccessor, resolveScope, } from './utils'; @@ -45,7 +44,7 @@ export default createRule({ calleeName === 'fail' || calleeName === 'pending' ) { - if (resolveScope(getScope(context, node), calleeName)) { + if (resolveScope(context.sourceCode.getScope(node), calleeName)) { // It's a local variable, not a jasmine global. return; } diff --git a/src/rules/no-large-snapshots.ts b/src/rules/no-large-snapshots.ts index c9aee9b87..3d7c89630 100644 --- a/src/rules/no-large-snapshots.ts +++ b/src/rules/no-large-snapshots.ts @@ -7,7 +7,6 @@ import { import { createRule, getAccessorValue, - getFilename, isSupportedAccessor, parseJestFnCall, } from './utils'; @@ -47,7 +46,7 @@ const reportOnViolation = ( node.expression.left.type === AST_NODE_TYPES.MemberExpression && isSupportedAccessor(node.expression.left.property) ) { - const fileName = getFilename(context); + const fileName = context.filename; const allowedSnapshotsInFile = allowedSnapshots[fileName]; if (allowedSnapshotsInFile) { @@ -106,7 +105,7 @@ export default createRule<[RuleOptions], MessageId>({ }, defaultOptions: [{}], create(context, [options]) { - if (getFilename(context).endsWith('.snap')) { + if (context.filename.endsWith('.snap')) { return { ExpressionStatement(node) { reportOnViolation(context, node, options); diff --git a/src/rules/no-test-return-statement.ts b/src/rules/no-test-return-statement.ts index 6cde8e75d..759290283 100644 --- a/src/rules/no-test-return-statement.ts +++ b/src/rules/no-test-return-statement.ts @@ -1,7 +1,6 @@ import { AST_NODE_TYPES, type TSESTree } from '@typescript-eslint/utils'; import { createRule, - getDeclaredVariables, getTestCallExpressionsFromDeclaredVariables, isFunction, isTypeOfJestFnCall, @@ -53,7 +52,7 @@ export default createRule({ context.report({ messageId: 'noReturnValue', node: returnStmt }); }, FunctionDeclaration(node) { - const declaredVariables = getDeclaredVariables(context, node); + const declaredVariables = context.sourceCode.getDeclaredVariables(node); const testCallExpressions = getTestCallExpressionsFromDeclaredVariables( declaredVariables, context, diff --git a/src/rules/prefer-comparison-matcher.ts b/src/rules/prefer-comparison-matcher.ts index ec356f656..a303d019f 100644 --- a/src/rules/prefer-comparison-matcher.ts +++ b/src/rules/prefer-comparison-matcher.ts @@ -4,7 +4,6 @@ import { createRule, getAccessorValue, getFirstMatcherArg, - getSourceCode, isBooleanLiteral, isStringNode, parseJestFnCall, @@ -115,7 +114,7 @@ export default createRule({ context.report({ fix(fixer) { - const sourceCode = getSourceCode(context); + const { sourceCode } = context; // preserve the existing modifier if it's not a negation const modifierText = diff --git a/src/rules/prefer-equality-matcher.ts b/src/rules/prefer-equality-matcher.ts index 02932692e..4b482801a 100644 --- a/src/rules/prefer-equality-matcher.ts +++ b/src/rules/prefer-equality-matcher.ts @@ -5,7 +5,6 @@ import { createRule, getAccessorValue, getFirstMatcherArg, - getSourceCode, isBooleanLiteral, parseJestFnCall, } from './utils'; @@ -73,7 +72,7 @@ export default createRule({ const buildFixer = (equalityMatcher: string): TSESLint.ReportFixFunction => fixer => { - const sourceCode = getSourceCode(context); + const { sourceCode } = context; // preserve the existing modifier if it's not a negation let modifierText = diff --git a/src/rules/prefer-importing-jest-globals.ts b/src/rules/prefer-importing-jest-globals.ts index 862a7d5fb..836c7fbc3 100644 --- a/src/rules/prefer-importing-jest-globals.ts +++ b/src/rules/prefer-importing-jest-globals.ts @@ -3,7 +3,6 @@ import { type JestFnType, createRule, getAccessorValue, - getSourceCode, isIdentifier, isStringNode, isSupportedAccessor, @@ -94,7 +93,7 @@ export default createRule({ messageId: 'preferImportingJestGlobal', data: { jestFunctions: Array.from(functionsToImport).join(', ') }, fix(fixer) { - const sourceCode = getSourceCode(context); + const { sourceCode } = context; const [firstNode] = sourceCode.ast.body; // check if "use strict" directive exists diff --git a/src/rules/prefer-jest-mocked.ts b/src/rules/prefer-jest-mocked.ts index 6389871a5..d462a696c 100644 --- a/src/rules/prefer-jest-mocked.ts +++ b/src/rules/prefer-jest-mocked.ts @@ -1,5 +1,5 @@ import { AST_NODE_TYPES, type TSESTree } from '@typescript-eslint/utils'; -import { createRule, followTypeAssertionChain, getSourceCode } from './utils'; +import { createRule, followTypeAssertionChain } from './utils'; const mockTypes = ['Mock', 'MockedFunction', 'MockedClass', 'MockedObject']; @@ -42,7 +42,7 @@ export default createRule({ return; } - const fnName = getSourceCode(context).text.slice( + const fnName = context.sourceCode.text.slice( ...followTypeAssertionChain(node.expression).range, ); diff --git a/src/rules/prefer-mock-promise-shorthand.ts b/src/rules/prefer-mock-promise-shorthand.ts index c32a456b7..008d276aa 100644 --- a/src/rules/prefer-mock-promise-shorthand.ts +++ b/src/rules/prefer-mock-promise-shorthand.ts @@ -5,7 +5,6 @@ import { createRule, getAccessorValue, getNodeName, - getSourceCode, isFunction, isSupportedAccessor, } from './utils'; @@ -69,7 +68,7 @@ export default createRule({ messageId: 'useMockShorthand', data: { replacement }, fix(fixer) { - const sourceCode = getSourceCode(context); + const { sourceCode } = context; // there shouldn't be more than one argument, but if there is don't try // fixing since we have no idea what to do with the extra arguments diff --git a/src/rules/prefer-spy-on.ts b/src/rules/prefer-spy-on.ts index c01ae1157..98b14a529 100644 --- a/src/rules/prefer-spy-on.ts +++ b/src/rules/prefer-spy-on.ts @@ -3,7 +3,7 @@ import { type TSESLint, type TSESTree, } from '@typescript-eslint/utils'; -import { createRule, getNodeName, getSourceCode } from './utils'; +import { createRule, getNodeName } from './utils'; const findNodeObject = ( node: TSESTree.CallExpression | TSESTree.MemberExpression, @@ -57,7 +57,7 @@ const getAutoFixMockImplementation = ( } const [arg] = jestFnCall.arguments; - const argSource = arg && getSourceCode(context).getText(arg); + const argSource = arg && context.sourceCode.getText(arg); return argSource ? `.mockImplementation(${argSource})` diff --git a/src/rules/prefer-to-contain.ts b/src/rules/prefer-to-contain.ts index b062e1f8b..c31e967aa 100644 --- a/src/rules/prefer-to-contain.ts +++ b/src/rules/prefer-to-contain.ts @@ -7,7 +7,6 @@ import { createRule, getAccessorValue, getFirstMatcherArg, - getSourceCode, hasOnlyOneArgument, isBooleanLiteral, isSupportedAccessor, @@ -88,7 +87,7 @@ export default createRule({ context.report({ fix(fixer) { - const sourceCode = getSourceCode(context); + const { sourceCode } = context; // we need to negate the expectation if the current expected // value is itself negated by the "not" modifier diff --git a/src/rules/unbound-method.ts b/src/rules/unbound-method.ts index 862c66df1..ddb7587e4 100644 --- a/src/rules/unbound-method.ts +++ b/src/rules/unbound-method.ts @@ -48,16 +48,6 @@ export type MessageIds = 'unbound' | 'unboundWithoutThisAnnotation'; const DEFAULT_MESSAGE = 'This rule requires `@typescript-eslint/eslint-plugin`'; -// todo: remove these along with the actual runtime properties below in new major -declare module '@typescript-eslint/utils/ts-eslint' { - interface RuleMetaDataDocs { - /** @deprecated */ - requiresTypeChecking?: boolean; - /** @deprecated */ - recommended?: unknown; - } -} - export default createRule({ defaultOptions: [{ ignoreStatic: false }], ...baseRule, @@ -73,12 +63,7 @@ export default createRule({ docs: { description: 'Enforce unbound methods are called with their expected scope', - /** @deprecated */ - requiresTypeChecking: true, ...baseRule?.meta.docs, - // mark this as not recommended - /** @deprecated */ - recommended: undefined, }, }, create(context) { diff --git a/src/rules/utils/__tests__/detectJestVersion.test.ts b/src/rules/utils/__tests__/detectJestVersion.test.ts index c2ffd2328..2ab7f7923 100644 --- a/src/rules/utils/__tests__/detectJestVersion.test.ts +++ b/src/rules/utils/__tests__/detectJestVersion.test.ts @@ -3,7 +3,6 @@ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import type { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package'; -import stripAnsi from 'strip-ansi'; import { create } from 'ts-node'; import { detectJestVersion } from '../detectJestVersion'; @@ -21,11 +20,11 @@ const relativePathToFn = 'eslint-plugin-jest/lib/rules/detectJestVersion.js'; const runNodeScript = (cwd: string, script: string) => { const { stdout, stderr } = spawnSync( 'node', - ['-e', script.split('\n').join(' ')], + ['-p', script.split('\n').join(' ')], { cwd, encoding: 'utf-8' }, ); - return { stdout: stripAnsi(stdout.trim()), stderr: stripAnsi(stderr.trim()) }; + return { stdout: stdout.trim(), stderr: stderr.trim() }; }; const runDetectJestVersion = (cwd: string) => { @@ -33,7 +32,7 @@ const runDetectJestVersion = (cwd: string) => { cwd, ` try { - console.log(require('${relativePathToFn}').detectJestVersion()); + require('${relativePathToFn}').detectJestVersion(); } catch (error) { console.error(error.message); } @@ -190,7 +189,7 @@ describe('detectJestVersion', () => { const { stdout, stderr } = runDetectJestVersion(projectDir); - expect(stdout).toBe(''); + expect(stdout).toBe('undefined'); expect(stderr).toContain('Unable to detect Jest version'); }); }); diff --git a/src/rules/utils/misc.ts b/src/rules/utils/misc.ts index 15c886487..71c8c91e1 100644 --- a/src/rules/utils/misc.ts +++ b/src/rules/utils/misc.ts @@ -174,7 +174,7 @@ export const removeExtraArgumentsFixer = ( const firstArg = func.arguments[from]; const lastArg = func.arguments[func.arguments.length - 1]; - const sourceCode = getSourceCode(context); + const { sourceCode } = context; let tokenAfterLastParam = sourceCode.getTokenAfter(lastArg)!; if (tokenAfterLastParam.value === ',') { @@ -225,44 +225,3 @@ export const getFirstMatcherArg = ( return followTypeAssertionChain(firstArg); }; - -/* istanbul ignore next */ -export const getFilename = ( - context: TSESLint.RuleContext, -) => { - return context.filename ?? context.getFilename(); -}; - -/* istanbul ignore next */ -export const getSourceCode = ( - context: TSESLint.RuleContext, -) => { - return context.sourceCode ?? context.getSourceCode(); -}; - -/* istanbul ignore next */ -export const getScope = ( - context: TSESLint.RuleContext, - node: TSESTree.Node, -) => { - return getSourceCode(context).getScope?.(node) ?? context.getScope(); -}; - -/* istanbul ignore next */ -export const getAncestors = ( - context: TSESLint.RuleContext, - node: TSESTree.Node, -) => { - return getSourceCode(context).getAncestors?.(node) ?? context.getAncestors(); -}; - -/* istanbul ignore next */ -export const getDeclaredVariables = ( - context: TSESLint.RuleContext, - node: TSESTree.Node, -) => { - return ( - getSourceCode(context).getDeclaredVariables?.(node) ?? - context.getDeclaredVariables(node) - ); -}; diff --git a/src/rules/utils/padding.ts b/src/rules/utils/padding.ts index edd071b05..43fb9a130 100644 --- a/src/rules/utils/padding.ts +++ b/src/rules/utils/padding.ts @@ -15,7 +15,7 @@ import { type TSESTree, } from '@typescript-eslint/utils'; import * as astUtils from './ast-utils'; -import { createRule, getSourceCode } from './misc'; +import { createRule } from './misc'; // Statement types we'll respond to export const enum StatementType { @@ -353,7 +353,7 @@ export const createPaddingRule = ( create(context) { const paddingContext = { ruleContext: context, - sourceCode: getSourceCode(context), + sourceCode: context.sourceCode, scopeInfo: createScopeInfo(), configs, }; diff --git a/src/rules/utils/parseJestFnCall.ts b/src/rules/utils/parseJestFnCall.ts index a4292287f..c74ea1426 100644 --- a/src/rules/utils/parseJestFnCall.ts +++ b/src/rules/utils/parseJestFnCall.ts @@ -12,7 +12,6 @@ import { TestCaseName, findTopMostCallExpression, getAccessorValue, - getScope, getStringValue, isIdentifier, isStringNode, @@ -183,22 +182,21 @@ const ValidJestFnCallChains = [ 'xtest.failing.each', ]; -// todo: switch back to using declaration merging once https://github.com/typescript-eslint/typescript-eslint/pull/8485 -// is landed -interface SharedConfigurationSettings { - jest?: { - globalAliases?: Record; - globalPackage?: string; - version?: number | string; - }; +declare module '@typescript-eslint/utils/ts-eslint' { + export interface SharedConfigurationSettings { + jest?: { + globalAliases?: Record; + globalPackage?: string; + version?: number | string; + }; + } } const resolvePossibleAliasedGlobal = ( global: string, context: TSESLint.RuleContext, ) => { - const globalAliases = - (context.settings as SharedConfigurationSettings).jest?.globalAliases ?? {}; + const globalAliases = context.settings.jest?.globalAliases ?? {}; const alias = Object.entries(globalAliases).find(([, aliases]) => aliases.includes(global), @@ -579,7 +577,10 @@ const resolveToJestFn = ( accessor: AccessorNode, ): ResolvedJestFn | null => { const identifier = getAccessorValue(accessor); - const maybeImport = resolveScope(getScope(context, accessor), identifier); + const maybeImport = resolveScope( + context.sourceCode.getScope(accessor), + identifier, + ); // the identifier was found as a local variable or function declaration // meaning it's not a function from jest @@ -589,8 +590,7 @@ const resolveToJestFn = ( if (maybeImport) { const globalPackage = - (context.settings as SharedConfigurationSettings).jest?.globalPackage ?? - '@jest/globals'; + context.settings.jest?.globalPackage ?? '@jest/globals'; // the identifier is imported from our global package so return the original import name if (maybeImport.source === globalPackage) { diff --git a/src/rules/valid-expect.ts b/src/rules/valid-expect.ts index b31496411..a643467aa 100644 --- a/src/rules/valid-expect.ts +++ b/src/rules/valid-expect.ts @@ -13,7 +13,6 @@ import { ModifierName, createRule, getAccessorValue, - getSourceCode, isFunction, isSupportedAccessor, parseJestFnCallWithReason, @@ -416,7 +415,7 @@ export default createRule<[Options], MessageIds>({ if (alwaysAwait && returnStatement) { const sourceCodeText = - getSourceCode(context).getText(returnStatement); + context.sourceCode.getText(returnStatement); const replacedText = sourceCodeText.replace('return', 'await'); fixes.push(fixer.replaceText(returnStatement, replacedText)); diff --git a/tsconfig.json b/tsconfig.json index 52e5fe5b3..57a4175f0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node16/tsconfig.json", + "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { "noEmit": true, "stripInternal": true, @@ -14,8 +14,7 @@ "strict": true, "resolveJsonModule": true, "isolatedModules": true, - // todo: required due to @typescript-eslint v7 - disable in new major - "skipLibCheck": true + "skipLibCheck": false }, "files": ["eslint-remote-tester.config.ts"], "include": ["src/**/*"], diff --git a/yarn.lock b/yarn.lock index f6ff3b2ad..7ae0f1f07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2545,9 +2545,9 @@ __metadata: linkType: hard "@sigstore/protobuf-specs@npm:^0.4.0, @sigstore/protobuf-specs@npm:^0.4.1": - version: 0.4.2 - resolution: "@sigstore/protobuf-specs@npm:0.4.2" - checksum: 5cb620dd8252a554b56fd2c33dc940cff08a8ab7d31ada5450da18512f3045ebdf5ceb61bb62e984da1bbb06cc0eaa380f090b7b901265a252f4b314d47c71b9 + version: 0.4.3 + resolution: "@sigstore/protobuf-specs@npm:0.4.3" + checksum: a1254864fd3b8795436a3720c61efafd8ca093d79d7bdb1de56a94ef7f7862cc07f2a5e11a926cad8fc58429bbcbba70c561581b0a52dbbef2d1248b8bf5748b languageName: node linkType: hard @@ -2667,10 +2667,10 @@ __metadata: languageName: node linkType: hard -"@tsconfig/node16@npm:^16.0.0": - version: 16.1.4 - resolution: "@tsconfig/node16@npm:16.1.4" - checksum: 99ed9232899f6e92b2c05cd7c7d16bae7dd9250d14d1af5d8f280023a47960c14c1ba4184e600231a21d70f02c2b2dba3ceb92e643b57aede1eaee2232a732c4 +"@tsconfig/node20@npm:^20.0.0": + version: 20.1.5 + resolution: "@tsconfig/node20@npm:20.1.5" + checksum: 6d689785f7b6ffd09d2cd0565290235ddc650932f6c110701dd38732b3c0b57ba039a3663268ae4a16b855d55ec2fbd48a53910e5a5fc7f196caaa4074dd0a53 languageName: node linkType: hard @@ -2815,11 +2815,11 @@ __metadata: linkType: hard "@types/node@npm:*": - version: 22.15.30 - resolution: "@types/node@npm:22.15.30" + version: 24.0.1 + resolution: "@types/node@npm:24.0.1" dependencies: - undici-types: ~6.21.0 - checksum: c380ad176575dc847a119e63afe457f3481c0095ef1720605d42b3133cac1c5980179643ce67c9a314c83b9a45f2b17bde5f15b29d8aa1d17e0a43318273829b + undici-types: ~7.8.0 + checksum: 8ef7aeddb2583657513d570b743f5226e19196a779e36bacad0c4079814ebe8fe7c0e580e897e4c7ce43dd98e177bfd9cbe9ef1696f76640c4322d65678b5c8c languageName: node linkType: hard @@ -2830,10 +2830,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^16.0.0": - version: 16.18.126 - resolution: "@types/node@npm:16.18.126" - checksum: 86112e7499f8a4d1bb60696cab0bf464adf3c141fca4bc5451e8f3aba5736529b76d4b4396edb21e5d7c19592852f7d6cb81ee70074fd13bde2db2d0db720467 +"@types/node@npm:^20.0.0": + version: 20.19.1 + resolution: "@types/node@npm:20.19.1" + dependencies: + undici-types: ~6.21.0 + checksum: f2883d8e2325af18424c625cc01ba2276c933ae8fc7aba93042fb757da075eabef0d2e22775e5706a74b67687d3cb06d6d42248d966c1e6bf8a2755457e537c7 languageName: node linkType: hard @@ -2889,39 +2891,39 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^8.0.0": - version: 8.34.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.34.0" + version: 8.33.1 + resolution: "@typescript-eslint/eslint-plugin@npm:8.33.1" dependencies: "@eslint-community/regexpp": ^4.10.0 - "@typescript-eslint/scope-manager": 8.34.0 - "@typescript-eslint/type-utils": 8.34.0 - "@typescript-eslint/utils": 8.34.0 - "@typescript-eslint/visitor-keys": 8.34.0 + "@typescript-eslint/scope-manager": 8.33.1 + "@typescript-eslint/type-utils": 8.33.1 + "@typescript-eslint/utils": 8.33.1 + "@typescript-eslint/visitor-keys": 8.33.1 graphemer: ^1.4.0 ignore: ^7.0.0 natural-compare: ^1.4.0 ts-api-utils: ^2.1.0 peerDependencies: - "@typescript-eslint/parser": ^8.34.0 + "@typescript-eslint/parser": ^8.33.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: f5d4a57d0661bea3b15b8842abeae3327828647540e8127c882d44cbf793e84d4c9e33b6740f682891ddf20ca664a634b7016289e1bc98ae21f02808498a28ec + checksum: 8732c42790728335c7f07947892302b5454340f0d4d80b2afaca33d1612e4ac8ad8c46b123337c207fe16b80964bd860992fc63b74addf8495bc6a61f7b9a18c languageName: node linkType: hard "@typescript-eslint/parser@npm:^8.0.0": - version: 8.34.0 - resolution: "@typescript-eslint/parser@npm:8.34.0" + version: 8.33.1 + resolution: "@typescript-eslint/parser@npm:8.33.1" dependencies: - "@typescript-eslint/scope-manager": 8.34.0 - "@typescript-eslint/types": 8.34.0 - "@typescript-eslint/typescript-estree": 8.34.0 - "@typescript-eslint/visitor-keys": 8.34.0 + "@typescript-eslint/scope-manager": 8.33.1 + "@typescript-eslint/types": 8.33.1 + "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/visitor-keys": 8.33.1 debug: ^4.3.4 peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: 7b6797c4d87e8b2e24f99bd2e9c4102366b8f77f4a2912f810df01d7b655524304859e0adef12c21dbbe986bacc7e45d35845d8c4439193350c38d8a14bb7ef7 + checksum: 2b527529a11738001a85494ceb56352a902d02989394ad480311fc273aa06ac282c039649433ed6396008a93c37b5d4d1c9bb5598b1526674e4d08dc2fccabe2 languageName: node linkType: hard @@ -2989,18 +2991,18 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.34.0": - version: 8.34.0 - resolution: "@typescript-eslint/type-utils@npm:8.34.0" +"@typescript-eslint/type-utils@npm:8.33.1": + version: 8.33.1 + resolution: "@typescript-eslint/type-utils@npm:8.33.1" dependencies: - "@typescript-eslint/typescript-estree": 8.34.0 - "@typescript-eslint/utils": 8.34.0 + "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/utils": 8.33.1 debug: ^4.3.4 ts-api-utils: ^2.1.0 peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: 97046c06edc6d15363f9a1e08ace2f774def8b903b42bf32db6e7f944f0f308273583b0ddd86c013e3f945bc15862d11625ff0d63578cc0b6f94a881f7337cef + checksum: 54099177a52d69fdb19bf12006c3ef543f54dde0772166e7986d085b11acc03eec7cc321450b3d98808c860b555b63476c1739409a4ca36c2635452c1f941cf2 languageName: node linkType: hard @@ -3058,33 +3060,33 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.34.0": - version: 8.34.0 - resolution: "@typescript-eslint/utils@npm:8.34.0" +"@typescript-eslint/utils@npm:8.33.1": + version: 8.33.1 + resolution: "@typescript-eslint/utils@npm:8.33.1" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.34.0 - "@typescript-eslint/types": 8.34.0 - "@typescript-eslint/typescript-estree": 8.34.0 + "@typescript-eslint/scope-manager": 8.33.1 + "@typescript-eslint/types": 8.33.1 + "@typescript-eslint/typescript-estree": 8.33.1 peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: ad55f2ec0a901da1f44064fdad06f4c3eabc2e42f26e6017e3b594a513d928f1fa5d58043b336f97019350f6e81c1fa508585b7877ec5f6a357f8c5d634d5cba + checksum: aef41fe93d7137336cd8bcc05ea56b55dfa86e2616a86176f51ee867607263a33eee025a2130d586a6a27d7e0564c9593bb3786073425dccd82b910e43984fae languageName: node linkType: hard "@typescript-eslint/utils@npm:^8.0.0, @typescript-eslint/utils@npm:^8.26.1": - version: 8.33.1 - resolution: "@typescript-eslint/utils@npm:8.33.1" + version: 8.34.0 + resolution: "@typescript-eslint/utils@npm:8.34.0" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.33.1 - "@typescript-eslint/types": 8.33.1 - "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/scope-manager": 8.34.0 + "@typescript-eslint/types": 8.34.0 + "@typescript-eslint/typescript-estree": 8.34.0 peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: aef41fe93d7137336cd8bcc05ea56b55dfa86e2616a86176f51ee867607263a33eee025a2130d586a6a27d7e0564c9593bb3786073425dccd82b910e43984fae + checksum: ad55f2ec0a901da1f44064fdad06f4c3eabc2e42f26e6017e3b594a513d928f1fa5d58043b336f97019350f6e81c1fa508585b7877ec5f6a357f8c5d634d5cba languageName: node linkType: hard @@ -3664,21 +3666,21 @@ __metadata: linkType: hard "brace-expansion@npm:^1.1.7": - version: 1.1.11 - resolution: "brace-expansion@npm:1.1.11" + version: 1.1.12 + resolution: "brace-expansion@npm:1.1.12" dependencies: balanced-match: ^1.0.0 concat-map: 0.0.1 - checksum: faf34a7bb0c3fcf4b59c7808bc5d2a96a40988addf2e7e09dfbb67a2251800e0d14cd2bfc1aa79174f2f5095c54ff27f46fb1289fe2d77dac755b5eb3434cc07 + checksum: 12cb6d6310629e3048cadb003e1aca4d8c9bb5c67c3c321bafdd7e7a50155de081f78ea3e0ed92ecc75a9015e784f301efc8132383132f4f7904ad1ac529c562 languageName: node linkType: hard "brace-expansion@npm:^2.0.1": - version: 2.0.1 - resolution: "brace-expansion@npm:2.0.1" + version: 2.0.2 + resolution: "brace-expansion@npm:2.0.2" dependencies: balanced-match: ^1.0.0 - checksum: a61e7cd2e8a8505e9f0036b3b6108ba5e926b4b55089eeb5550cd04a471fe216c96d4fe7e4c7f995c728c554ae20ddfc4244cad10aef255e72b62930afd233d1 + checksum: 01dff195e3646bc4b0d27b63d9bab84d2ebc06121ff5013ad6e5356daa5a9d6b60fa26cf73c74797f2dc3fbec112af13578d51f75228c1112b26c790a87b0488 languageName: node linkType: hard @@ -3691,7 +3693,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.24.0, browserslist@npm:^4.24.4": +"browserslist@npm:^4.24.0, browserslist@npm:^4.25.0": version: 4.25.0 resolution: "browserslist@npm:4.25.0" dependencies: @@ -3806,9 +3808,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001718": - version: 1.0.30001721 - resolution: "caniuse-lite@npm:1.0.30001721" - checksum: 1f1e1f5f070f97ee83a08601709413300957be624790a8f7b3aebd5746d648e8d50be4ef9572a50281198b2f7acc63fdfc1a0bc04c23bbffba0ab4b3c69d4b76 + version: 1.0.30001723 + resolution: "caniuse-lite@npm:1.0.30001723" + checksum: 0acd7f33f15cfc6cf81a5155bb288afb34ce63cddd90bbf1740243b3c6c1de813ad10b393650f1c15e47f13ff4da61a8d14b02fac8e47e7367aede3ef162a1c6 languageName: node linkType: hard @@ -4280,13 +4282,13 @@ __metadata: linkType: hard "conventional-commits-parser@npm:^6.0.0": - version: 6.1.0 - resolution: "conventional-commits-parser@npm:6.1.0" + version: 6.2.0 + resolution: "conventional-commits-parser@npm:6.2.0" dependencies: meow: ^13.0.0 bin: conventional-commits-parser: dist/cli/index.js - checksum: c9b660b3aaa48576ee3a1fdf21f4c236d7f19991e8a8a121e24105b3470b15440310e5b3cbf4dd51fb4a0185e66bee7ee875354d29f47c234719629ecf40ac77 + checksum: 57fc957d80d46b575a6ed2b193da8ea84dc85c82c54632ad1de7dcb9f8c22c55bff046827f991944c4bbe446f84b8196dd6b062cd5461f238cf75c719d904e20 languageName: node linkType: hard @@ -4312,11 +4314,11 @@ __metadata: linkType: hard "core-js-compat@npm:^3.40.0": - version: 3.42.0 - resolution: "core-js-compat@npm:3.42.0" + version: 3.43.0 + resolution: "core-js-compat@npm:3.43.0" dependencies: - browserslist: ^4.24.4 - checksum: 4f0a7db9ed9a95c4edae0749fe9a4d4d4f8f51a53c7c3e06049887500e98763732e8afef9628d2145f875b6e262567e951a77e4d06273f9eac273f5241259fd3 + browserslist: ^4.25.0 + checksum: 32d1383c3d6bf84b8bb41b5a1e0a45bf8144ea3f7b913a7e83dd51f1252e9db9c187c4e34877b39ac5661be51a03655694c3a01e03637b895c39f7908f440c77 languageName: node linkType: hard @@ -4805,9 +4807,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.5.160": - version: 1.5.165 - resolution: "electron-to-chromium@npm:1.5.165" - checksum: 49725e9c02fcc2b1a89aa2624603d151b1da1ac7a9c017d9ab91f894f463466fea210785b46dea184bbaf3871893b2dac8e062fe05b94348d8e2853e91737e63 + version: 1.5.167 + resolution: "electron-to-chromium@npm:1.5.167" + checksum: 6c329894b61359c3d998736d493e0c9f9beb24533caf28d95e33340dc34b13467b09cf1a8e3c47240ee0e816c98f50d8f1e6cb7f2cdc18f910a5ee79fc1e316f languageName: node linkType: hard @@ -5230,10 +5232,10 @@ __metadata: "@schemastore/package": ^0.0.10 "@semantic-release/changelog": ^6.0.0 "@semantic-release/git": ^10.0.0 - "@tsconfig/node16": ^16.0.0 + "@tsconfig/node20": ^20.0.0 "@types/eslint": ^8.4.6 "@types/jest": ^29.0.0 - "@types/node": ^16.0.0 + "@types/node": ^20.0.0 "@types/semver": ^7.5.8 "@typescript-eslint/eslint-plugin": ^8.0.0 "@typescript-eslint/parser": ^8.0.0 @@ -5241,7 +5243,7 @@ __metadata: babel-jest: ^29.0.0 babel-plugin-replace-ts-export-assignment: ^0.0.2 dedent: ^1.5.0 - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 eslint-config-prettier: ^10.0.0 eslint-doc-generator: ^2.0.0 eslint-plugin-eslint-plugin: ^6.0.0 @@ -5261,12 +5263,11 @@ __metadata: rimraf: ^5.0.0 semantic-release: ^24.0.0 semver: ^7.3.5 - strip-ansi: ^6.0.0 ts-node: ^10.2.1 typescript: ^5.0.4 peerDependencies: - "@typescript-eslint/eslint-plugin": ^6.0.0 || ^7.0.0 || ^8.0.0 - eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + "@typescript-eslint/eslint-plugin": ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 jest: "*" peerDependenciesMeta: "@typescript-eslint/eslint-plugin": @@ -5277,8 +5278,8 @@ __metadata: linkType: soft "eslint-plugin-n@npm:^17.0.0": - version: 17.19.0 - resolution: "eslint-plugin-n@npm:17.19.0" + version: 17.20.0 + resolution: "eslint-plugin-n@npm:17.20.0" dependencies: "@eslint-community/eslint-utils": ^4.5.0 "@typescript-eslint/utils": ^8.26.1 @@ -5292,7 +5293,7 @@ __metadata: ts-declaration-location: ^1.0.6 peerDependencies: eslint: ">=8.23.0" - checksum: 04b4babc87c062d88109ce80440d98b700b14a8021ecd5d6c2d7bcad6b69563d4bcf7066ec933a43fd352376dd6cfd441e322222ecd6539b8903cf2eb3caec37 + checksum: 5e695e2cbfd8772cf074c8ec1bc5e1d1afed86b30998eed4263768f102249c400bf2be2dfb8f6059c2ca7b43dbfdb4025e7b2b804f4e1c6b21ef33f85a9934f9 languageName: node linkType: hard @@ -5364,13 +5365,13 @@ __metadata: linkType: hard "eslint-visitor-keys@npm:^4.2.0": - version: 4.2.0 - resolution: "eslint-visitor-keys@npm:4.2.0" - checksum: 779c604672b570bb4da84cef32f6abb085ac78379779c1122d7879eade8bb38ae715645324597cf23232d03cef06032c9844d25c73625bc282a5bfd30247e5b5 + version: 4.2.1 + resolution: "eslint-visitor-keys@npm:4.2.1" + checksum: 3a77e3f99a49109f6fb2c5b7784bc78f9743b834d238cdba4d66c602c6b52f19ed7bcd0a5c5dbbeae3a8689fd785e76c001799f53d2228b278282cf9f699fff5 languageName: node linkType: hard -"eslint@npm:^7.0.0 || ^8.0.0": +"eslint@npm:^8.57.0": version: 8.57.1 resolution: "eslint@npm:8.57.1" dependencies: @@ -5657,14 +5658,14 @@ __metadata: linkType: hard "fdir@npm:^6.4.4": - version: 6.4.5 - resolution: "fdir@npm:6.4.5" + version: 6.4.6 + resolution: "fdir@npm:6.4.6" peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: picomatch: optional: true - checksum: 14efd2d6617a6f9fb314916ccff64e00bdb96216f26542ec9dfa532ed60a7ebb45463f7009aa215c14071566bf43caeb8ba268ccb52a11e6b51e4aaa8cb58d81 + checksum: fe9f3014901d023cf631831dcb9eae5447f4d7f69218001dd01ecf007eccc40f6c129a04411b5cc273a5f93c14e02e971e17270afc9022041c80be924091eb6f languageName: node linkType: hard @@ -8805,9 +8806,9 @@ __metadata: linkType: hard "normalize-url@npm:^8.0.0": - version: 8.0.1 - resolution: "normalize-url@npm:8.0.1" - checksum: 43ea9ef0d6d135dd1556ab67aa4b74820f0d9d15aa504b59fa35647c729f1147dfce48d3ad504998fd1010f089cfb82c86c6d9126eb5c5bd2e9bd25f3a97749b + version: 8.0.2 + resolution: "normalize-url@npm:8.0.2" + checksum: 66a0d42ae9e360654d8547a73f8c94fc8a39a975c7d3ae0b95e5927bd3bffc6dc4e20282afd6797c4a7ce6cf3847c37ce47125fde7b1a9e83d802c0e74830dee languageName: node linkType: hard @@ -10642,12 +10643,12 @@ __metadata: linkType: hard "socks@npm:^2.8.3": - version: 2.8.4 - resolution: "socks@npm:2.8.4" + version: 2.8.5 + resolution: "socks@npm:2.8.5" dependencies: ip-address: ^9.0.5 smart-buffer: ^4.2.0 - checksum: cd1edc924475d5dfde534adf66038df7e62c7343e6b8c0113e52dc9bb6a0a10e25b2f136197f379d695f18e8f0f2b7f6e42977bf720ddbee912a851201c396ad + checksum: d39a77a8c91cfacafc75c67dba45925eccfd884a8a4a68dcda6fb9ab7f37de6e250bb6db3721e8a16a066a8e1ebe872d4affc26f3eb763f4befedcc7b733b7ed languageName: node linkType: hard @@ -11491,6 +11492,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~7.8.0": + version: 7.8.0 + resolution: "undici-types@npm:7.8.0" + checksum: 59521a5b9b50e72cb838a29466b3557b4eacbc191a83f4df5a2f7b156bc8263072b145dc4bb8ec41da7d56a7e9b178892458da02af769243d57f801a50ac5751 + languageName: node + linkType: hard + "undici@npm:^7.10.0": version: 7.10.0 resolution: "undici@npm:7.10.0"