Open YElyousfi opened 8 months ago
Does this help? There is an example specifically for an eslint plugin
Is it possible to run the project's npm ci
command using the dependencies from the package.json file instead of specifying each plugin?
The error below is what ultimately led to me posting this issue. I have cwd
set to root and it fails when running my project's npm prepare
after install.
In these kind of problems, I like to temporarily add something like pwd
and ls -la
to see where I am. Remember that Megalinter runs in a Docker container, and thus the folder with the repo is mounted. So things done outside the Docker container and things done inside the container aren't exactly the same.
Yes, of course outside the repo the path on a GitHub runner would be /github/workspace, but I expect something else inside the container.
So I see how it fails to install your other dependencies, as is-ci and husky aren't recognized.
I see, thanks for clarifying, it's very much appreciated!
I tried debugging with ls -l
with cwd: root
and everything seems to be fine in the screenshot below with all the files. I see the mounted files as 127 including the repo's package.json file. However, node_modules
is root
and its contents are not what the repo's package.json defines.
What is the recommended approach to properly run an npm clean-install
as PRE_COMMAND for the relevant linters? Do we need to copy or give root access to the package.json of the repository?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
Hello,
New to using megalinter (great tool) and wanted to know if additional plugins for eslint could be installed during runtime. I couldn't find and documentation, examples, or issues on this. I was thinking this could be accomplished via the precommands but figured I'd also ask here as well.