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

Add support for generating ESLint Flat Config

Open conradhale opened this issue 2 years ago • 4 comments
trafficstars

Will fix https://github.com/vuejs/eslint-plugin-vue/issues/1291

Needs more work, haven't had the time to work on this lately.

I was thinking it would be better to replace the generated config files with JS functions that dynamically return the correct configuration. Should decrease the size of the library and make the code a bit cleaner with the addition of flat configs and probably wouldn't impact runtime performance much. Most other eslint plugins seem to be doing this as well.

conradhale avatar Nov 18 '23 03:11 conradhale

It might be a while before I have time to work on this, if any maintainers want to take over this PR, feel free to make any edits.

conradhale avatar Nov 18 '23 04:11 conradhale

@conradhale Thanks! I added some more commits, could you please have a look at them? I am not sure what is still missing to have full Flat config support, so I am handing this back to you again :slightly_smiling_face:

FloEdelmann avatar Dec 04 '23 19:12 FloEdelmann

@ota-meshi Is there anything blocking this PR from being merged now? I have been implementing npm init @eslint/config for the flat configs, so it would be great see it's officially supported in the plugin. 😄

aladdin-add avatar Feb 07 '24 06:02 aladdin-add

@conradhale I can pick this up! (if you don't mind :)

aladdin-add avatar Feb 07 '24 06:02 aladdin-add

I would like the configuration to be renamed. Correspond as follows:

  • (Legacy -> Flat)
  • essential -> flat/vue2-essential
  • strongly-recommended -> flat/vue2-strongly-recommended
  • recommended -> flat/vue2-recommended
  • vue3-essential -> flat/essential
  • vue3-strongly-recommended -> flat/strongly-recommended
  • vue3-recommended -> flat/recommended https://github.com/vuejs/eslint-plugin-vue/pull/2319/files#r1465649137

We also need test code to test the flat configuration.

ota-meshi avatar Feb 19 '24 01:02 ota-meshi