-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Error while linting large application #18787
Comments
Increasing Node's memory to 16GB completes the linting task, but it takes a long time, about an hour! If I run the eslint command manually, it takes much less time and consumes less memory resources. |
This is an interesting problem, @mcfdez. For us to investigate this, we need more information:
|
Hello, Running the Unfortunately, we can't share the repository as I don't have permissions for it, but I can say that the Frontend application is an Angular 16 application with a few thousand files and in which, we have configured dozens of eslint plugins and hundreds of rules. As for the configuration of About the reason why we have decided to convert the ESLint configuration files from JSON to JS is because we need to use the Attached is the configuration of the base eslintrc.js from the repository.
Thanks |
If you would run lint with This should cover all the files
If that works, next you can run it with
|
Hello, If I run ESLint without NX, with the command "npx eslint ..." it takes much less time to linte the application and in case of errors, it displays them smoothly on screen. The problem has only appeared running npx nx lint frontend with a Node memory lower than 16GB. |
Can you share what the report of the I'm interested to know which rules eat up most of your memory. You are likely using some expensive rules in those overrides ( Can you also share what is in those override files? On a side note, this: parserOptions: {
tsconfigRootDir: __dirname + '/../..',
project: ["tsconfig.base.json"]
}, can be rewritten without parserOptions: {
project: ["../../tsconfig.base.json"]
}, It's advised, though, not to use root config directly but rather point to the application's tsconfig, which then extends the root one. This allows you to optimize the config without modifying the root one. |
Since you can't share access to the repo, I would be open for a short debugging/pairing session to investigate why the runs are slow. Let me know if this would be an option. |
Hello We have changed the .eslintrc.js files to .json again and correctly referenced the tsconfig.json of the applications instead of the tsconfig.base.json as you suggested. The linter works correctly, but only with a large memory consumption (between 16 and 24GB). With lower memory, the task terminates with no result. We have run the eslint command directly (without NX), and that way, as we have said before, it runs faster and if a failure occurs, we can see it. We attach the execution of the output of the command with the TIMING parameter (we have put 100 but we could put a higher number since we have many rules).
As for the contents of the various linter files, we have many and with many rules, but we attach a screenshot of the package.json to give you an idea of the number of plugins we are using.
Finally, about the possibility of doing a joint session, we will talk about it in the team. Thank you very much! |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Can you try running lint with with enough memory to produce results when run with Btw. your command listed above is not the same as what My suggestion is to get rid of Slow rules are not worth the check. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Running
npx nx lint appName
starts the linting process. After a long time, it fails without yielding any information.It is worth saying that if we reduce the scope of the files to lint, it works correctly, it only fails when the amount of files to lint is high (about 3000).
This is the Angular configuration of the project:
And this one, the ESLint configuration of the application
This is the output of the command
Expected Behavior
Finish the lining process correctly.
Nx Report
Failure Logs
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: