Open stevepolitodesign opened 3 months ago
These guides were shared while discussing Suspenders and this issue during our Web team sync.
Eslint Migrate to 9.x Guide Configuration Migration Guide Importing Plugins and Custom Parsers
Based on the guides, I tried to create a eslint.config.js
like this:
const globals = require("globals");
const js = require("@eslint/js");
const thoughtbotBase = require("@thoughtbot/eslint-config/base");
module.exports = [
js.configs.recommended,
{
files: ["**/*.js"],
plugins: {
"@thoughtbot-eslint": thoughtbotBase,
},
},
];
but hit an error in @rushstack/eslint-patch
.
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
at Object.<anonymous> (.../eslint-config/node_modules/@rushstack/eslint-patch/lib/_patch-base.js:167:19)
This does seem like an issue in @rushstack/eslint-patch
with an open https://github.com/microsoft/rushstack/issues/4635 to sort eslint-patch
for ESLint 9.
I found in a playground how Flat configs must be specified for ESLint 9.0.0+ and tried that. After installing a few @typescript-eslint
dependencies, the config in the playground repo worked well for my example project. So this indicated that we need to add support for Flag configs in our eslint-config
based on https://github.com/typescript-eslint/typescript-eslint/pull/7935 where something similar was done.
Based on all this information, I feel like supporting ESLint 9.0.0+ might take longer due to our external dependencies.
Environment
yarn:
1.22.17
node:21.4.0
Steps to reproduce
yarn add eslint@latest
yarn add @thoughtbot/eslint-config --dev
.eslintrc.json
with the following:ESLINT_USE_FLAT_CONFIG
set tofalse
per the latest release's recommendations.Note the following output: