From 334c7fbedc47370036c655ffbea6b07ddea610db Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 1 May 2026 14:44:11 -0700 Subject: [PATCH 1/2] Revert "Don't load eslintrcs even in expectOnly" This reverts commit 5b4f002986e32c17546e4c9e1c0fbe5391c119cc. --- packages/dtslint/src/lint.ts | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/packages/dtslint/src/lint.ts b/packages/dtslint/src/lint.ts index 6147bb03d2..e560b21290 100644 --- a/packages/dtslint/src/lint.ts +++ b/packages/dtslint/src/lint.ts @@ -112,35 +112,23 @@ function getEslintOptions( ], }; - // Always disable cascading .eslintrc.* discovery. Contributor-authored config files in - // types// would otherwise be loaded by ESLint 8's legacy eslintrc engine, which - // resolves `extends` and `parser` (including in `overrides[]`) via - // createRequire(configFilePath).resolve(value) and require()s the result. Since dtslint has - // no file-extension allowlist, a contributor could ship a `.cjs` payload alongside - // `.eslintrc.json` and obtain arbitrary code execution in the lint process. - const baseOverrideConfig = { - plugins: ["@definitelytyped", "@typescript-eslint", "jsdoc"], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - warnOnUnsupportedTypeScriptVersion: false, - }, - ...overrideConfig, - }; - if (expectOnly) { return { useEslintrc: false, - overrideConfig: baseOverrideConfig, + overrideConfig: { + plugins: ["@definitelytyped", "@typescript-eslint", "jsdoc"], + parser: "@typescript-eslint/parser", + parserOptions: { + project: true, + warnOnUnsupportedTypeScriptVersion: false, + }, + ...overrideConfig, + }, }; } return { - useEslintrc: false, - overrideConfig: { - ...baseOverrideConfig, - extends: ["plugin:@definitelytyped/all"], - }, + overrideConfig, }; } From 4701eeb3550c7e6b885bf038d43c653bd6d7f2a9 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 1 May 2026 14:44:35 -0700 Subject: [PATCH 2/2] changeset --- .changeset/flat-socks-shop.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/flat-socks-shop.md diff --git a/.changeset/flat-socks-shop.md b/.changeset/flat-socks-shop.md new file mode 100644 index 0000000000..84ee0ed8b9 --- /dev/null +++ b/.changeset/flat-socks-shop.md @@ -0,0 +1,5 @@ +--- +"@definitelytyped/dtslint": patch +--- + +Revert eslintrc loading change