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 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, }; }