jfmengels / node-elm-review

CLI for elm-review
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
BSD 3-Clause "New" or "Revised" License
48 stars 25 forks source link

Found several modules named `ReviewConfig` #140

Closed jamesrweb closed 6 months ago

jamesrweb commented 1 year ago

In a new project I ran the setup to init elm-review for an application, when I run the review process though, I get the following error:

-- ELM-REVIEW ERROR ----------------------------------------------- GLOBAL ERROR

: Found several modules named ReviewConfig

I found several modules with the name ReviewConfig. Depending on how I choose to resolve this, I might give you different reports. Since this is a compiler error anyway, I require this problem to be solved. Please fix this then try running elm-review again.

Here are the paths to some of the files that share a module name:

  • node_modules/elm-review/init-templates/DefaultReviewConfig.elm
  • node_modules/elm-review/init-templates/ReviewConfigForExample.elm
  • review/src/ReviewConfig.elm

It is possible that you requested me to look at several projects, and that modules from each project share the same name. I don't recommend reviewing several projects at the same time, as I can only handle one elm.json. I instead suggest running elm-review twice, once for each project.

I found 1 error in 1 file.

I run the script using npm run lint which itself is just defined as elm-review . in the package.json, any ideas why this is happening? I have both elm-review and elm-format installed via npm to use in the package.json as I am sure you can see from the above output but this is a normal setup so not sure why this error is occurring.

jfmengels commented 1 year ago

You should not have to run elm-review ., only elm-review, which by default runs on all Elm files as defined by your elm.json.

By adding ., you're telling elm-review you also want review all the files in ., which happen to include the node_modules and all the Elm files in there (including some Elm files used internally by the CLI).


I'm curious why you wanted to add the .. Is it because you're used to doing so with other tools like ESLint?

jamesrweb commented 1 year ago

You should not have to run elm-review ., only elm-review, which by default runs on all Elm files as defined by your elm.json.

By adding ., you're telling elm-review you also want review all the files in ., which happen to include the node_modules and all the Elm files in there (including some Elm files used internally by the CLI).


I'm curious why you wanted to add the .. Is it because you're used to doing so with other tools like ESLint?

Actually that's how I've used elm-review for years now in other projects, just never had this issue crop up until now which is why I was confused.

Not sure what the difference is that's causing this to appear now, since im not doing anything different than usual which should have an effect on elm-review. I have structured my ELM project differently to usual, even still, that shouldn't have an effect on elm-review.

In answer to your question, tools like elm-format or prettier or generally most tools I run with the . syntax, I don't think there's any tool I use that doesn't use the root path as a built in default or required parameter.

Anyway good information for the future also, thanks! You can close the issue if you wish or if you have clarifying questions or something, do let me know and I'll happily answer them 👌🏻