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

EslintIntegration does not work with vue files #854

Closed
ymdhrk opened this issue Jun 20, 2019 · 2 comments
Closed

EslintIntegration does not work with vue files #854

ymdhrk opened this issue Jun 20, 2019 · 2 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@ymdhrk
Copy link

ymdhrk commented Jun 20, 2019

Even though prettier.eslintIntegration is enabled, eslint -fix is not applied but only prettier is applied.
I think most issues related with vue are in the same situation.

After a lot of digging, I finaly found out what caused this issue.

How this issue occured

  1. vue project is created with vue cli

    • The default parser option for eslint is configured as below
    "parser":"vue-eslint-parser"
    "parserOptions": {
      "parser": "babel-eslint"
    }
    
  2. prettier-vscode format the vue file with eslintintegration

    • prettier-vscode call bundled eslint-prettier
    • bundled eslint-prettier call bundled vue-eslint-parser regardless of user's settings
    • bundled vue-eslint-parser can't resolve babel-eslint in parserOptions.parser because babel-eslint is not bundled with prettier-vscode and eslint-prettier
    • eslint -fix stop with the error, so only prettir is applied

solution

eslint-prettir should not overwritte the parser that user provided.
Fortunately the eslint-prettir problem is fixed by the latest release.

So the solution for prettier-vscode is to update eslint-prettir version to 9.0.0.

@ntotten
Copy link
Member

ntotten commented Aug 24, 2019

Due to the huge amount of bugs, linting support has been deprecated in version 2.0.0. See the documentation on the recommended configuration: https://github.com/prettier/prettier-vscode#vscode-eslint-and-tslint-integration

See #870 for more details.

@ntotten ntotten closed this as completed Aug 24, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants