vuejs/eslint-plugin-vue

Deprecate shareable configs

ota-meshi opened this issue ยท 11 comments

The problem you want to solve.

Most of the shareable configs provided by this plugin are based on style guide.
However, the link to Vue's style guide seems to have been removed.

https://github.com/vuejs/docs/blob/74449a840c88ee9488e2337081302a993e14e1f6/.vitepress/config.ts#L18
vuejs/docs@4acd127

So, I suspect that these configs are based on deprecated documentation.

Your take on the correct solution to problem.

Deprecate shareable configurations other than plugin:vue/base.
Provide shareable configurations based on the new standards, if needed.

Additional context

https://github.com/vuejs/eslint-plugin-vue/issues?q=label%3A%22matter+of+taste%22

I'm not sure if that's a good idea. I think most people use the recommended config and they would need to enable dozens of rules manually, which is quite a bit of work and bloats up the ESLint config.

Maybe we can instead create new shareable configs based on other criteria? E.g. "error prevention" and "layout" rules?

Or just leave it as it is, and curate the configs ourselves based on good judgement?

https://vuejs.org/style-guide/
They are not complete and not up-to-date, but I think they are still quite useful, especially the essential ones.

Maybe we can start a project to discuss the new guidance?
And before it's finished, put a small warning on the ESLint plugin documentation page, like what the official style guide does now?

Thank you for your comment.

I think most people use the recommended config and they would need to enable dozens of rules manually, which is quite a bit of work and bloats up the ESLint config.
Maybe we can instead create new shareable configs based on other criteria? E.g. "error prevention" and "layout" rules?

If we deprecate shareable configs provided by this plugin, I would publish a new shareable config as a personal project. It's probably two configurations like "error prevention" and "layout".
However these are configured according to my preferences. Not official. Because I think the official recommended style is now deprecated.

Maybe we can start a project to discuss the new guidance?

I think it's good to discuss the new(?) style guide. But I'm not sure of the right place to discuss style guides. Additionally, I personally prefer the Options API. Therefore, I am a little worried about whether I can properly participate in the discussion ๐Ÿ˜…

If we create a new style guide, the following PR might be a good starting point.
vuejs/v2.vuejs.org#2839

By the way, if we continue to provide new sharable configs officially, we can consider separating them from this plugin. Changing the shareable configuration is a breaking change and cannot be changed often when shipped with plugins. Separating shareable configurations allows us to keep up with style guide updates.

By the way, if we continue to provide new sharable configs officially, we can consider separating them from this plugin. Changing the shareable configuration is a breaking change and cannot be changed often when shipped with plugins. Separating shareable configurations allows us to keep up with style guide updates.

Didn't think about this before. But yeah, it sounds good!

A "deprecated in vue 3" config for use in vue 2 projects wanting to upgrade at some point would be great!

Hi @thedamon. Your suggestion sounds good, but I'd like to discuss deprecating (or removing) the configuration provided by the plugin in this issue.

I still think shareable configs should be deprecated. The shareable configuration that plugins currently provide is mostly subjective. Whether or not user use these configurations is user preference and we are not forcing user to do anything.
But I think the users who use it feel like we're forcing them to follow those rules.

What if they're renamed to include the keyword "stylistic" or something like this?
It's the same thing as typescript-eslint does: https://typescript-eslint.io/users/configs#recommended-configurations

Sorry. I don't understand English well, so I'm not sure, but if we include the word stylistic in the name of the config, will people stop complaining about the config provided by the plugin?

will people stop complaining

I don't feel like we get many requests to change the configs, do we?

I still don't think the configs should be removed. Almost all ESLint plugins I know also have some kind of "recommended" config to help users get started quickly. Having to install a config from a separate package would complicate this, and break with the conventions.

Because I think the official recommended style is now deprecated.

The style guide is still available on the official Vue docs (https://vuejs.org/style-guide/), and while it's not linked from the menu and called "outdated and needs to be reviewed", I don't think it's deprecated.

If we deprecate shareable configs provided by this plugin, I would publish a new shareable config as a personal project. It's probably two configurations like "error prevention" and "layout".
However these are configured according to my preferences. Not official.

Note that creating a Vue-specific config in a separate package is already possible, so maybe you could do that and see how it works? Also we could discuss how your personal config would differ from the vue3-recommended one?

@ota-meshi No, see typescript-eslint's page:

image

What I meant is to have all the code quality rules (like vue/prefer-import-from-vue) in a recommended preset (pretty much all the rules that are in the strongly-recommended and recommended rules from the current presets) and everything that it's opinionated or style-based (like vue/attributes-order) into a recommended-stylistic preset, so users could choose between code quality rules and stylistic rules or both at the same time