Description
The new type definitions sometimes contain string literals of regexes as types. This does not work as expected.
Steps to reproduce
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3gGQIaIgVxgEEAPYAZwBo4iA7WiGbGYCWgXzgDMoIQ4ARGAA2jYYgB0AK3ICA3ACgFAExQBjYdiho1bcvGxlyALjg48hUhUWGKE8muzCU2WmoAW0OAF5BJeUqqGlo6egb0jMystKZ0DEwsbDYRCdEShtpcPn4ATAFAA
Notes
At least these types are affected (generated with grep -RF "'/^" plotly.js/):
plotly.js/src/types/generated/schema.d.ts: anchor?: 'free' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: matches?: '/^x([2-9]|[1-9][0-9]+)?( domain)?$/' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: overlaying?: 'free' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: scaleanchor?: '/^x([2-9]|[1-9][0-9]+)?( domain)?$/' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/' | false;
plotly.js/src/types/generated/schema.d.ts: axref?: 'pixel' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: ayref?: 'pixel' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: xref?: 'paper' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: yref?: 'paper' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: xref?: 'paper' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: yref?: 'paper' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: xref?: 'paper' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: yref?: 'paper' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/';
plotly.js/src/types/generated/schema.d.ts: xref?: 'paper' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/' | ('paper' | '/^x([2-9]|[1-9][0-9]+)?( domain)?$/')[];
plotly.js/src/types/generated/schema.d.ts: yref?: 'paper' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/' | ('paper' | '/^y([2-9]|[1-9][0-9]+)?( domain)?$/')[];
Some of these can be represented with template literal types: 'paper' | `x${number | ""}${" domain" | ""}`
Description
The new type definitions sometimes contain string literals of regexes as types. This does not work as expected.
Steps to reproduce
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3gGQIaIgVxgEEAPYAZwBo4iA7WiGbGYCWgXzgDMoIQ4ARGAA2jYYgB0AK3ICA3ACgFAExQBjYdiho1bcvGxlyALjg48hUhUWGKE8muzCU2WmoAW0OAF5BJeUqqGlo6egb0jMystKZ0DEwsbDYRCdEShtpcPn4ATAFAA
Notes
At least these types are affected (generated with
grep -RF "'/^" plotly.js/):Some of these can be represented with template literal types:
'paper' | `x${number | ""}${" domain" | ""}`