eslint-config-canonical
eslint-config-canonical copied to clipboard
Support "Flat Config" (ESLint 9)
👋 Coming over from https://github.com/eslint/eslint/issues/18093: ESLint is migrating to a new "flat config" format that will be the default in ESLint v9.
It doesn't look like eslint-config-canonical has support yet. Just for fun, I tried it out in a repository with the new eslint.config.js:
// eslint.config.js
import eslint from "@eslint/js";
import canonical from "eslint-config-canonical";
export default [eslint.configs.recommended, canonical];
...and got an error from @rushstack/eslint-patch (https://github.com/microsoft/rushstack/issues/4372):
$ npx eslint .
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> (/Users/josh/repos/repros/node_modules/@rushstack/eslint-patch/lib/_patch-base.js:166:19)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/Users/josh/repos/repros/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:11:23)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
Does that mean eslint-config-canonical is blocked on https://github.com/microsoft/rushstack/issues/4372 for supporting flat config?
I'm posting this issue here as a reference & cross-linking it to the table in https://github.com/eslint/eslint/issues/18093. If there's anything blocking the extension from supporting flat configs, please let us know - we'd be happy to try to help! 💜
Additional resources:
- Configuration Migration Guide
- (edit) Plugin Migration Guide
- Blog posts on the new config system: Part 1: Background, Part 2: Introduction to flat config
Pretty sure @rushstack/eslint-patch will need to be removed in order to support flat config.