Skip to content

@feathersjs/generators ignores .prettierrc #3517

Description

@buxit

Steps to reproduce

create .prettierrc with

{
  "semi": true,
}

run npx featers generate service to create a service

Expected behavior

lines should end with semicolons

Actual behavior

.prettierrc is ignored

Probable fix

prettier.resolveConfig() seems to expect a file, not a directory. testing suggests that the file doesn't have to exist.
in packages/generators/src/commons.ts the line

const config = (await prettier.resolveConfig(ctx.cwd)) || options

could be changed to something like this:

const config = (await prettier.resolveConfig(join(ctx.cwd, '.prettierrc'))) || options

according to my minimal testing, cwd can also be omitted completely:

const config = (await prettier.resolveConfig()) || options

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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