Skip to content
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

feat: replace eslint-loader by eslint-webpack-plugin #6094

Merged
merged 10 commits into from
Dec 7, 2020

Conversation

fangbinwei
Copy link
Collaborator

@fangbinwei fangbinwei commented Nov 28, 2020

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:
close #5926, using eslint-webpack-plugin can fix the problem of eslint-loader caused by cache-loader, related issue: #3065, #5399, #4425

eslint@7 contains a break change related to plugin resolution

In previous versions, ESLint resolved all plugins from the current working directory by default. Starting in ESLint v7.0.0, plugins are resolved relative to the directory path of the entry configuration file.

After checking the rfc, I believe new behavior is reasonable and it does not conflict with the current project. So I didn't set resolvePluginsRelativeTo like create-react-app

TODO

@fangbinwei
Copy link
Collaborator Author

fangbinwei commented Nov 28, 2020

  • It seems some test failed because there isn't enough memory in the container.
    set 'threads' of eslint-webpack-plugin by 'options.parallel' to solve this problem.

@fangbinwei fangbinwei force-pushed the eslint-webpack-plugin branch from 1e2f8db to f67bc93 Compare November 30, 2020 04:00
@fangbinwei
Copy link
Collaborator Author

After bumping the version of eslint-webpack-plugin, the tests failed. It seems threads is not compatible with webpack mutil-compiler(build commonjs2 umd lib, etc) create a new issue webpack-contrib/eslint-webpack-plugin#56
Also considering the threads related issue, maybe it's best to threads false now.

Although eslint-webpack-plugin disable 'threads' by default, it's better set it explicitly
Copy link
Member

@haoqunjiang haoqunjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@haoqunjiang haoqunjiang merged commit a153af8 into vuejs:dev Dec 7, 2020
@fangbinwei fangbinwei deleted the eslint-webpack-plugin branch January 25, 2021 14:15
@ap-patel
Copy link

ap-patel commented Jan 22, 2022

Hi @sodatea @fangbinwei , this fix doesn't seem to be in the latest release for vue-cli-eslint (4.5.15) which was released 3 months ago.
Current release points to

https://github.com/vuejs/vue-cli/blob/22a8a788e84cacec0c07407214f87a0819399ebf/packages/%40vue/cli-plugin-eslint/index.js

If i want this fix, is it safe to use 5.0.0-rc2?

@haoqunjiang
Copy link
Member

Yes, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@vue/cli-plugin-eslint needs to update eslint-loader[deprecated] to eslint-webpack-plugin
3 participants