Comments (2)
TLDR: underscore naming will be fixed.
Okay quotes are needed so you can create a more "creative" type name without typescript compiler giving you an error for example
interface InterfaceName {
1hello: "sample"
}
interface InterfaceName {
!hello: "sample"
}
interface InterfaceName {
hell@: "sample"
}
All of these example will give an error so the quotes are mandatory. I wasnt able to find a regex that would check if object property name is valid without quotes (to be honest gave up after 30 minutes), so I can be sure when to put the quotes. So I took a firm stance on this and said "if name starts with characters and has some numbers after then its fine else I quote the name".
Since underscore if very common and never creates problems I will include those into that name checking.
from json-to-ts.
fixed with 7a5348d
from json-to-ts.
Related Issues (20)
- how about proto to ts ? HOT 1
- possible to add generate entity for typeorm? HOT 2
- How to export the interfaces? HOT 1
- Not detecting date objects correctly HOT 1
- null is not handled correctly HOT 2
- Reduce of empty array with no initial value HOT 1
- Feature request: docblocks for entities and attributes HOT 1
- "Try it Online" link going to malware site HOT 2
- One combined Interface instead of many smaller ones
- An option to turn off nullable union field spec? HOT 3
- feature request: Option to disable duplicate type prevention
- Sort interface keys option
- String literals? HOT 1
- VSCode extension creates new files per interface HOT 2
- incorrect optional on null HOT 4
- Possibility to add code as url parameters? A REST API even? HOT 1
- Add CLI HOT 2
- please add intellij pluging HOT 1
- Fails conversion from selection when single quotes are used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-to-ts.