-
Notifications
You must be signed in to change notification settings - Fork 339
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
ESLint config in a lerna subpackage is not loaded correctly #455
Comments
Thanks for the detailed issue report. Looking at your project structure I think you need to configure proper working directories for the ESLint extension. See here for how to do this: https://github.com/Microsoft/vscode-eslint. The setting is: If this doesn't help would you be able to distill a small example and create a GitHub repository for it which I can clone. This would definitely ease tracking this down. |
Thanks for the hint @dbaeumer but it looks like that this setting doesn't work properly in our case (added to the workspace settings and reloaded the editor). I'll try to create an example project setup as GitHub repository until the beginning of the next week. 😃 |
Great. Ping me when available. |
Hey @dbaeumer, example project is ready under janbiasi/vscode-eslint-issue-455, hit me up if you need more information. |
@janbiasi thanks for the GitHub repository. This is definitely a setup issue. Executing |
Executing eslint from |
Using the following setting
Makes eslint work. I will add something to the doc about |
Thank you @dbaeumer, this fixed our issue! Also a huge thanks for the super-fast service 😃 |
@dbaeumer Thanks, I think I figured out the issue. My webpack config is written using babel. So in
To run test I have to include babel-register to parse the config file properly. Works
Fails
My though was that the
|
|
@dbaeumer Sure. If I understand correctly, we need to add a config option that allows an additional argument passed to the child process |
Yes, that is correct. But the actual options needs to be defined in ESlint. So we need changes here and in the |
We currently have a problem with the eslint extension in combination with a lerna setup and multiple configuration files. The described issue occurs in a commercial project for a big company with closed source, so we can not add logs or traces to this issue - but we'll describe the error case as good as possible.
The Problem
ESLint in the VSCode (IDE only) will show errors for the
import/resolver
section inside the subpackage for the main application and it looks like that the ESLint extension is not reading the overwritten configuration file from the subpackage and is using the root.eslintrc.js
.Error case e.g.
/packages/apps/main-app/src/ComponentXY.js
If we run the
DEBUG=eslint-plugin-import:* ./node_modules/.bin/eslint --fix
command on the project level we'll receive all errors displayed in the IDE that ESLint is not able to resolve the references to the components with absolute path. But if we run the exact same command inside our subpackage (/packages/apps/main-app/
) we don't get any error about resolving modules.So we assume that this is an issue with the VSCode ESLint extension because this behaviour only appears inside the IDE.
As temporary solution we switched our whole team to Atom because there is no issue with the ESLint integration. We're looking forward to get a solution for this weird behaviour.
Project information
The project uses the lerna structure with the folder
packages
, in this folder we have a wrapper folder for all apps of our customer calledapps
. Inside the apps we havemain-app
project and an additional.eslintrc.js
configuration which will add the capability to resolve modules without the relative paths (e.g.src/Component
instead of../src/Component
).Our project structure
configs/eslint-config/node.js (root
.eslintrc.js
)packages/apps/main-app/.eslintrc.js
lerna.json
General information
The text was updated successfully, but these errors were encountered: