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
Prettier 3.7.4
Playground link
Input:
Output:
Expected output:
Why?
Should keep consistency