spotless: spotless/prettier - .npmrc seems to be ignored
My company is using a different registry for npm, specified by .npmrc:
registry = https://artifacthub.company.com/api/npm/npm-virtual/
sass_binary_site = https://artifacthub.company.com/node-bindings/4.10.0/
disturl = https://artifacthub.company.com/nodejs/
It appears that spotless is not picking those up. Is there any way I can add this as parameter to the prettier format? (essentially it needs to run npm install -registry=.... ...)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (12 by maintainers)
Personally, I’ve never used the npmrc. Based on the documentation, the most project-specific approach is to have a
.npmrcfile next to thepackage.jsonwhen running npm.I think this would fit into the current api, using a similar approach to the
npmExecutablesetting:(Another approach would be to try do autodiscover the
.npmrcfile by looking at the locations${project.projectDir}/.npmrc,${rootProject.projectDir}/.npmrcand$HOME/.npmrc- but even such an approach would need a possibility to override the location)What do you think?
ok, so I’ll update the docs and create the PR.