sanity-io / eslint-config-studio

The ESLint configuration that ships with new Sanity Studio projects. Designed to be relatively unobtrusive to help find bugs instead enforce opinions.
MIT License
7 stars 0 forks source link

Add support for ESLint flat config #39

Open mheob opened 1 month ago

mheob commented 1 month ago

Is your feature request related to a problem?

ESLint has changed the default configuration style to flat config. Currently this extension does not work immediately.

Describe the solution you'd like

To use this extension in the latest ESLint versions, it should support flat config. A migration guide is provided by ESLint.

lentilz commented 1 week ago

Attempts at using this with Flat Compat returns the below error:

Error: Key "plugins": Cannot redefine plugin "react" at .../sanity-cms/node_modules/@humanwhocodes/object-schema/src/object-schema.js:250:27

eslint.config.js settings tried the below with the same error each time

  1. ...compat.extends("@sanity/eslint-config-studio")
  2. ...compat.extends(resolve(__dirname, "node_modules/@sanity/eslint-config-studio")),