Questionable output when property title is "Symbol"
This schema:
{
// ...
"type": "object",
"properties": {
"displaySymbol": {
"title": "Symbol",
"type": "string",
"nullable": true
},
// ...
}
Emits:
export type Symbol = string;
export interface Currency {
displaySymbol: Symbol;
}
Which is a violation of eslint's ban-types rule:
Don't use
Symbolas a type. Use symbol instead
This is happening because Symbol is a reserved word in JavaScript.
To resolve this eslint issue and reduce ambiguity, the generated type name for this property should be something distinct, such as Symbol1
Symbol isn't a reserved word; it's a global object.
I think it should just have an annotation to exclude es-lint.
@meeq, what behavior would you expect?
You shouldn't name your interface Symbol, since Symbol is a global in JS. You might end up with some sneaky bugs and/or TypeScript issues elsewhere in your code