gajus/eslint-config-canonical

Support "Flat Config" (ESLint 9)

Closed this issue ยท 4 comments

๐Ÿ‘‹ Coming over from eslint/eslint#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 (microsoft/rushstack#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 microsoft/rushstack#4372 for supporting flat config?

I'm posting this issue here as a reference & cross-linking it to the table in eslint/eslint#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:

Pretty sure @rushstack/eslint-patch will need to be removed in order to support flat config.

Canonical now supports v9

I think README has a bug:

export default [
  auto
];

Should be

export default [
  ...auto
];

Yeah, README is still WIP, and so is the API. Learning new tips and tricks as I am rolling it out to the projects that I work with.

Should be stable by the end of the day.