standard / eslint-config-semistandard

:100: semistandard eslint sharable config
ISC License
63 stars 23 forks source link

Support ESLint 9 Flat Config Format #65

Open gtbuchanan opened 3 months ago

gtbuchanan commented 3 months ago

Here's what I did

Upgrade to ESLint 9 and import eslint-config-semistandard

import globals from 'globals';
import semistandard from 'eslint-config-semistandard';

export default [
  semistandard,
  {
    ignores: ["dist/**"],
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.es2021,
        ...globals.node
      }
    }
  }
];

What I expected to happen

I should be able to import semistandard in eslint.config.js and use it as a default ruleset (see eslint-config-standard usage).

https://github.com/standard/eslint-config-standard/commit/3d1284ce50d9af2ef7a8803ec6e7339c2c985730

What seems to have happened

ESLint reports the following error:

Oops! Something went wrong! :(

ESLint: 9.0.0

A config object is using the "extends" key, which is not supported in flat config system.

Instead of "extends", you can include config objects that you'd like to extend from directly in the flat config array.

Please see the following page for more information:
https://eslint.org/docs/latest/use/configure/migration-guide#predefined-and-shareable-configs
gtbuchanan commented 3 months ago

Looks like eslint-config-standard doesn't work either even though they added support for the flat config format. There were breaking changes to the format in ESLint 9.

https://github.com/standard/eslint-config-standard/issues/410