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

Prettier config not resolved correctly #158

Open
lorenzomigliorero opened this issue Feb 15, 2024 · 0 comments
Open

Prettier config not resolved correctly #158

lorenzomigliorero opened this issue Feb 15, 2024 · 0 comments

Comments

@lorenzomigliorero
Copy link

lorenzomigliorero commented Feb 15, 2024

The resolveConfig method is invoked with process.cwd() as first argument.

const prettierConfig = await resolveConfig(process.cwd())

Using process.cwd() as argument the config returns null on Node v18.17.0.
Without it, the config is resolved correctly.

.prettierrc

{
  trailingComma': 'es5',
  tabWidth: 2,
  semi: true,
  singleQuote: true,
  printWidth: 80,
  proseWrap: 'never'
}

index.js

const prettier = require("prettier");
const prettierConfig = await resolveConfig(process.cwd()) // null
const prettier = require("prettier");
const prettierConfig = await resolveConfig() // resolved correctly
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

No branches or pull requests

1 participant