[eslint-config] Failed to patch ESLint because the calling module was not recognized using @rushstack/eslint-patch with ESLint 9.17.0 #5075
Labels
effort: medium
Needs a somewhat experienced developer
help wanted
If you're looking to contribute, this issue is a good place to start!
Summary
I encountered an issue when trying to run ESLint with @rushstack/eslint-patch. The following error is thrown:
Error: Failed to patch ESLint because the calling module was not recognized.
If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
https://github.com/microsoft/rushstack/issues
Repro steps
1.Install dependencies
npm install [email protected] [email protected] @rushstack/[email protected]
2.Create eslint.config.js with the following content
import tailwindcss from "eslint-plugin-tailwindcss";
import eslintConfigNext from "eslint-config-next";
export default [
...eslintConfigNext().flatMap((config) => config),
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: {
tailwindcss,
},
rules: {
"tailwindcss/classnames-order": "warn",
"tailwindcss/no-custom-classname": "off",
},
settings: {
"import/resolver": {
typescript: {},
},
},
},
];
3.Run ESLint:
npx eslint . --fix
Expected result:
ESLint should run successfully and apply linting rules as per the configuration.
Actual result:
The following error is thrown:
Oops! Something went wrong! :(
ESLint: 9.17.0
Error: Failed to patch ESLint because the calling module was not recognized.
If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
https://github.com/microsoft/rushstack/issues
Details
The issue appears to be related to @rushstack/eslint-patch not recognizing the calling module. I have ensured that the installed versions of eslint, eslint-config-next, and @rushstack/eslint-patch are compatible based on their peer dependency requirements.
Installed dependencies:
npm list eslint eslint-config-next @rushstack/eslint-patch
├── @rushstack/[email protected]
├─┬ [email protected]
│ ├── @rushstack/[email protected] deduped
│ ├─┬ @typescript-eslint/[email protected]
│ │ ├─┬ @typescript-eslint/[email protected]
│ │ │ └── [email protected] deduped
│ │ ├─┬ @typescript-eslint/[email protected]
│ │ │ └── [email protected] deduped
│ │ └── [email protected] deduped
│ ├─┬ @typescript-eslint/[email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
└─┬ [email protected]
└─┬ @eslint-community/[email protected]
└── [email protected] deduped
I have also tried removing and reinstalling these dependencies, but the issue persists.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@rushstack/eslint-config
version?node -v
)?The text was updated successfully, but these errors were encountered: