-
-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(eslint): revert #682 adding eslint-plugin-vue to devDependency #826
base: master
Are you sure you want to change the base?
Conversation
This reverts commit 7cef146. The eslint-plugin-vue isn't configured to be used by the .eslintrc.js, so it's installed redundantly as long as only `prettier` rule is used. If officially installed via `npx @vue/cli add @vue/cli-plugin-eslint`, it adds ['plugin:vue/essential','eslint:recommended','@vue/prettier'] to the extends array; or it can be used with `plugin:vue/recommended`, but it needs further analysis to avoid some other potential conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-plugin-vue is used by eslint-config, so adding it in create-nuxt-app is for fixing hoisting dependency issue.
I see, the eslint-config (rule and npm project both named Could you link me to any resource regarding the hoisting issue, or did you observe it causing any compilation error that is still relevant? I was doing a project cleanup and didn't notice any issues after removing it, and I'd personally prefer having the version of the transitive dependency kept compatible by eslint-config, so it may be useful for owners of projects based on this generator to have any information about the motivation behind including it explicitly to avoid them making the same mistake. I didn't find any PR related to 7cef146. Thanks! |
I wasn't able to reproduce the issue even from that example. I think it's likely that it has been already fixed by some dependency update. Also you linked the same issue twice, did you mean nuxt/eslint#134? |
Sorry nuxt/eslint#134 |
In case we keep this here, as a long-term solution I'd suggest to at least list it somewhere (e.g. in Readme) as part of temporary workarounds, so that it's clear to users that it's intended to be removed whenever the project can function without it, rather than making it a permanent choice that we'll always be afraid to remove. (Personally I'd prefer making them opt-in as a separate step, as I'm sure that the number of workarounds will keep growing.)
|
Thanks for all the feedback. For this specific issue, I think having eslint-plugin-vue in deps is the best approach for now, this is not a generic issue like other transitive deps in real application, create-nuxt-app is a template app for generating apps, so it may have more deps combinations and transitive deps are more complex, if any other package like a UI or nuxt module also depends on eslint-plugin-vue, a wrong version may be installed into root node_modules and cache, so it may lead to unexpected error.
This is a good point to think about, the purpose of this project is to provide users with a more convenient and easy way to generate nuxt applications, so reducing complexity and improving doc are definitely important. Help and contribution are always welcome, and we all very much appreciate it. Regarding the linter issues, because cc @nuxt/framework may have other comments. |
Yeah if there are any other motivation like avoiding conflicts of I know that a detailed documentation isn't supposed to be a responsibility of scaffolding project, but it's sadly the only source of truth we have when it comes to compatibility of dependencies. I hope this generator will grow to cover all the major use-cases, and that it'll be the responsibility of third party library maintainers to come and fix any issues here directly rather than hoping that the generator's maintainers will figure out all the peculiar conflicts due to pressure from desperate users, as that's usually already too late 😄 (I think even this PR should be in ideal case an opinionated decision by Regarding replacement of the |
This reverts commit 7cef146.
The eslint-plugin-vue isn't configured to be used by the .eslintrc.js, so it's installed redundantly as long as only
prettier
rule is used.If officially installed via
npx @vue/cli add @vue/cli-plugin-eslint
, it adds['plugin:vue/essential','eslint:recommended','@vue/prettier']
to the extends array; or it can be used withplugin:vue/recommended
, but it needs further analysis to avoid some other potential conflicts.