storybookjs / eslint-plugin-storybook

🎗Official ESLint plugin for Storybook
MIT License
238 stars 42 forks source link

feat: support flat config and eslint v9 #152

Closed kazupon closed 1 month ago

kazupon commented 3 months ago

Issue: #135

What Changed

I've supported ESLint flat configuration and eslint v9 This PR has compatible for legacy style configuration and compatible eslint API using.

So to maintain compatibility, we provide a preset with the flat namespace.

flat config example is here:

import storybook from 'eslint-plugin-storybook'

export default [
  // add more generic rulesets here, such as:
  // js.configs.recommended,
  ...storybook.configs['flat/recommended'],

  // something ...
]

This implementation is based on eslint-plugin-vue, which has several presets to support Vue 3 and Vue 2. docs is here: https://eslint.vuejs.org/user-guide/#usage

Checklist

Check the ones applicable to your change:

Change Type

Indicate the type of change your pull request is:

@shilman @ndelangen I used to help out some with Vue support at Storybook. https://github.com/storybookjs/storybook/pull/1267 https://github.com/storybookjs/storybook/pull/1477 https://github.com/storybookjs/storybook/pull/1595

I am happy to contribute to storybook for the first time in 7 years again! ☺️

yannbf commented 3 months ago

This is fantastic @kazupon! Thanks a lot for your contribution(s)! Happy to see you're back into contributing. I'll take a look into this PR once I have some focus time here <3

shilman commented 3 months ago

@kazupon welcome back & thanks so much for your contribution -- it's great to see you again! 🙌

heddn commented 2 months ago

Eslint v9 just was released, making the enhancements here more important.

kazupon commented 2 months ago

I've just supported comatibility for eslint v8 and v9

yannbf commented 1 month ago

Hey @kazupon sorry for the long time, I was only able to check this now. I created a new PR based on your branch at #156 so that we can get CI checks and canary releases to test out (given that you did the changes via a fork, they were not triggered). Let's continue working from there!