From e11ec0b736cc624334f02c893d662cb6914919ae Mon Sep 17 00:00:00 2001 From: Rolando Bosch Date: Tue, 24 Feb 2026 22:46:25 -0800 Subject: [PATCH] fix(eslint-plugin-tsdoc): replace deprecated ESLint APIs for v10 compatibility Replace `context.getSourceCode()` with `context.sourceCode ?? context.getSourceCode()` and `context.getCwd?.()` with `context.cwd ?? context.getCwd?.()` to support ESLint 10 while maintaining backward compatibility with older versions. Fixes microsoft/tsdoc#455 Co-Authored-By: Claude Opus 4.6 --- .../eslint-10-compat_2026-02-25-06-44.json | 10 ++++++++++ eslint-plugin/src/index.ts | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 common/changes/eslint-plugin-tsdoc/eslint-10-compat_2026-02-25-06-44.json diff --git a/common/changes/eslint-plugin-tsdoc/eslint-10-compat_2026-02-25-06-44.json b/common/changes/eslint-plugin-tsdoc/eslint-10-compat_2026-02-25-06-44.json new file mode 100644 index 00000000..56322906 --- /dev/null +++ b/common/changes/eslint-plugin-tsdoc/eslint-10-compat_2026-02-25-06-44.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "eslint-plugin-tsdoc", + "comment": "Replace deprecated `context.getSourceCode()` and `context.getCwd()` with `context.sourceCode` and `context.cwd` for ESLint 10 compatibility, with fallback for older versions.", + "type": "patch" + } + ], + "packageName": "eslint-plugin-tsdoc" +} diff --git a/eslint-plugin/src/index.ts b/eslint-plugin/src/index.ts index 3bf2e77b..ab0c35ae 100644 --- a/eslint-plugin/src/index.ts +++ b/eslint-plugin/src/index.ts @@ -35,7 +35,7 @@ function getRootDirectoryFromContext(context: TSESLint.RuleContext