Skip to content

Property names are quoted one level deep in inferred type #3957

@dragomirtitian

Description

@dragomirtitian

Steps to reproduce

function createSlice<T>(o: T) {
    return o
}
export const platformSlice = createSlice({
    "query": {
        "search" : "",
        "user": ""
    },
});

Playground Link

Behavior with typescript@6.0

All quotes around properties are stripped

export declare const platformSlice: {
    query: {
        search: string;
        user: string;
    };
};

Behavior with tsgo

Properties one level deep have quotes preserved.

export declare const platformSlice: {
    query: {
        "search": string;
        "user": string;
    };
};

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions