eslint-plugin-panda icon indicating copy to clipboard operation
eslint-plugin-panda copied to clipboard

feat: support ESLint v9 & Flat Config

Open koba04 opened this issue 1 year ago • 3 comments

Fixes #61

This adds ESLint v9 support & Flat Config.

TODO:

  • [ ] Update all deps for ESLint
  • [ ] test eslint-docgen
  • [ ] Provide a better way to use eslint-plugin-panda with ESLint v9 (Flat Config)
  • [ ] Have different sandboxes for traditional config and v9 config (@anubra266 sneaked this in 😉 )

We can already use @pandacss/eslint-plugin like this

import panda from '@pandacss/eslint-plugin'

export default  [
  {
    plugins: {
      '@pandacss': panda,
    },
    rules: {
      ...panda.configs.recommended.rules,
    }
  }
]

See more details https://github.com/koba04/eslint-plugin-panda/blob/eslint-v9/sandbox/eslint.config.mjs

koba04 avatar May 15 '24 14:05 koba04

@koba04 Thanks for picking this up. Just wanted to note, that we'd like to be backward compatible, so there'd have to be an entry that exposes support for the traditional config.

anubra266 avatar May 15 '24 15:05 anubra266

Yeah, I expect the current implementation works with ESLint v9 (Flat Config), and this still works with ESLint v8 and Legacy Config. In fact, I don't have any changes for plugin implementation.

So this might be good enough to have the document for Flat Config setting.

koba04 avatar May 15 '24 15:05 koba04

I've confirmed eslint-docgen doesn't work with ESLint v9. https://github.com/wikimedia/eslint-docgen/issues/138

koba04 avatar May 16 '24 10:05 koba04

@koba04 I've updated your PR.

  • We use legacy eslint in project root for backwards compatibility.
  • We now have two sandboxes two test legacy and v9 respectively

anubra266 avatar Jun 18 '24 02:06 anubra266

Sorry, I couldn't have much time to work on it, and thank you for working on this!

koba04 avatar Jun 18 '24 14:06 koba04