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

[Bug]: ESLint extension on VS Code can not find the config file #142

Open
1 task done
haotan19 opened this issue Dec 8, 2021 · 2 comments
Open
1 task done

[Bug]: ESLint extension on VS Code can not find the config file #142

haotan19 opened this issue Dec 8, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@haotan19
Copy link
Contributor

haotan19 commented Dec 8, 2021

Operating system

Windows 10

Node.js version

14.16.0

Shopify CLI version

2.7.2

Browsers

Chrome

Version

4 (Current)

Modifications

No response

Details

Problem:
It seems ESLint extension can not detect the .config/.eslintrc.js
ESLint error is not showing up in the VS Code with ESLint extension. But the yarn fix:js work just fine.


Steps:

  1. Clone & yarn the project
  2. Create a component under src/vue/components/render
  3. Use Ctrl+Shift+Uto open OUTPUT in VS Code, select the ESLint output, and it said:
[Info  - 10:38:15 AM] ESLint server is starting
[Info  - 10:38:16 AM] ESLint server running in node v14.16.0
[Info  - 10:38:16 AM] ESLint server is running.
[Info  - 10:38:17 AM] ESLint library loaded from: D:\_shopify\concept-themes\Nov-14-theme\node_modules\eslint\lib\api.js
[Warn  - 10:38:22 AM] 
No ESLint configuration (e.g .eslintrc) found for file: d:\_shopify\concept-themes\Nov-14-theme\src\vue\components\render\mouse-target.vue
File will not be validated. Consider running 'eslint --init' in the workspace folder Nov-14-theme
Alternatively you can disable ESLint by executing the 'Disable ESLint' command.

Notice

  • I read the notice
@haotan19 haotan19 added the bug Something isn't working label Dec 8, 2021
@haotan19 haotan19 changed the title [Bug]: YOUR TITLE HERE [Bug]: ESLint extension on VS Code can not find the config file Dec 8, 2021
@haotan19
Copy link
Contributor Author

haotan19 commented Dec 8, 2021

Possible fix:

Create a .vscode/settings.json file:

{
    "eslint.options": {
        "configFile": "[Your eslintrc.js file path]",
    },
}

My working example:

{
    "eslint.options": {
        "configFile": ".config/.eslintrc.js",
    },
}

@haotan19
Copy link
Contributor Author

haotan19 commented Dec 8, 2021

I created a PR #143 , hope this helps!

haotan19 added a commit to haotan19/shopify-theme-lab that referenced this issue Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant