Skip to content

Prettier config not resolved correctly #158

Open
@lorenzomigliorero

Description

@lorenzomigliorero

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions