Skip to content
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

npm run prettier should be given --no-config option #11135

Closed
rudifa opened this issue Mar 3, 2023 · 1 comment · Fixed by #11136
Closed

npm run prettier should be given --no-config option #11135

rudifa opened this issue Mar 3, 2023 · 1 comment · Fixed by #11136

Comments

@rudifa
Copy link
Contributor

rudifa commented Mar 3, 2023

cesium/package.json contains 2 prettier scripts:

  "scripts": {
  ...
    "prettier": "prettier --write  \"**/*\"",
    "prettier-check": "prettier --check  \"**/*\""
  ...
  }

Problem: if the user has a .prettierrc* config file in one of parent directories, e.g. $HOME, options in that file may contradict the default option values that cesium relies on.

I suggest that above scripts should be given the option --no-config, which would avoid any interference from the user's config files.

my operating System: macOS 13.2.1
my prettier version: 2.8.4
cesium prettier version: 2.1.2

Note: my $HOME/.prettierrc contains the option "bracketSameLine": true, which is unknown to prettier 2.1.2, so running npm run prettier-check produces a warning Ignored unknown option �bracketSameLine: true for every cesium file scanned, which masks any real warnings.

@ggetz
Copy link
Contributor

ggetz commented Mar 3, 2023

Thanks @rudifa, good catch! I don't think we ever ran into this situation before.

I confirmed the --no-config option doesn't interfere with ignored files, so it should be safe to use. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants