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

VSCode shows eslint error with '@vue/airbnb' when using webpack aliases in import paths #2546

Closed
KokoTa opened this issue Sep 18, 2018 · 16 comments

Comments

@KokoTa
Copy link

KokoTa commented Sep 18, 2018

Version

3.0.3

image

Node and OS info

Node 10.7.0

Steps to reproduce

Vscode will throw error, but app running successful.

What is expected?

no error info

What is actually happening?

throw error info


@LinusBorg
Copy link
Member

Please share the repository

@KokoTa
Copy link
Author

KokoTa commented Sep 19, 2018

image
Build with default configuration @LinusBorg

@LinusBorg
Copy link
Member

Do npm run serve and npm run build work?

@KokoTa
Copy link
Author

KokoTa commented Sep 19, 2018

yes, running successful.

@LinusBorg
Copy link
Member

LinusBorg commented Sep 19, 2018

and npm run lint ?

@KokoTa
Copy link
Author

KokoTa commented Sep 19, 2018

The same situation,app can work,but error still exist.
image
image

@LinusBorg
Copy link
Member

So the error is only in your editor? Then I think your editor's eslint integration doesn't play nice with eslint-airbnb ?

@LinusBorg
Copy link
Member

Possibly related: microsoft/vscode-eslint#405

@KokoTa
Copy link
Author

KokoTa commented Sep 19, 2018

I use Vscode, I don't know. OK, I try to see it.

@LinusBorg LinusBorg changed the title throw error in eslint when use '@vue/airbnb' VSCode shows eslint error with '@vue/airbnb' when using webpack aliases in import paths Sep 19, 2018
@blitheinsz
Copy link

1 upgrade vscode editor
2 upgrade vscode-plugin ESLint to 1.7
3 ok

@2xAA
Copy link

2xAA commented Jan 14, 2019

Actually, red herring. The project folder is a subdirectory of a larger project. (SublimeLinter-)eslint was getting confused.

SublimeLinter-eslint seems to also have the same issue.

eslint version v5.12.0 (local and global)
Latest Sublime Linter and SublimeLinter-eslint

Built with vue cli 3.3.0. Vuex, Router and Airbnb linting.
node version 11.5.0.

npm run build also works fine.
screen shot 2019-01-14 at 15 32 09

@LinusBorg
Copy link
Member

Then you should probably open an issue in their repository. We can't influence how your editor plugins work

@haoqunjiang
Copy link
Member

No longer reproducible with the latest versions of vscode, vscode-eslint, @vue/cli…
So I'm closing this issue.

@STLighter
Copy link

Actually, red herring. The project folder is a subdirectory of a larger project. (SublimeLinter-)eslint was getting confused.

SublimeLinter-eslint seems to also have the same issue.

eslint version v5.12.0 (local and global)
Latest Sublime Linter and SublimeLinter-eslint

Built with vue cli 3.3.0. Vuex, Router and Airbnb linting.
node version 11.5.0.

npm run build also works fine.
screen shot 2019-01-14 at 15 32 09

Same problem with you! When I open the subdirectory only, everything works well. But if I open the large project, vscode shows no-unresolved error.

vscode: v1.30.2
eslint extension: v1.8.0

@TaylorDale
Copy link

TaylorDale commented Apr 15, 2019

Same problem with you! When I open the subdirectory only, everything works well. But if I open the large project, vscode shows no-unresolved error

Thanks for that - spent a good hour on this one trying to figure out why it wasn't resolving.

@dpgalloway
Copy link

In case anyone else is still struggling with this, I realized the same thing as others that the issue was caused by my front-end code being in a sub-directory of the main project. To fix, add this to your settings.json (change "client" to the name of your front-end sub-directory):

    "eslint.workingDirectories": [
      { "directory": "./client", "changeProcessCWD": true },
    ],

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

No branches or pull requests

8 participants