Skip to content

method signature doesn't quote in consistent quote props #18470

Description

@Dunqing

Prettier 3.7.4
Playground link

--parser babel-ts
--quote-props consistent

Input:

// Correct
const MyObject =  {
  method() {},
  "method-2"() {}
};

// Incorrect! `method` should be quoted
type MyType = {
  method(): void;
  "method-2"(): string;
};

Output:

// Correct
const MyObject = {
  "method"() {},
  "method-2"() {},
};

// Incorrect! `method` should be quoted
type MyType = {
  method(): void;
  "method-2"(): string;
};

Expected output:

// Correct
const MyObject = {
  "method"() {},
  "method-2"() {},
};

// Incorrect! `method` should be quoted
type MyType = {
  "method"(): void;
  "method-2"(): string;
};

Why?

Should keep consistency

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions