JavaScript / TypeScript Styleguide
Single Quotes vs Double Quotes
String delimiters matter. Explore the quote preferences across popular TypeScript projects with real-world data.
66%
Use Single Quotes
34%
Use Double Quotes
Team Single Quotes
Minimal visual noise and the de facto standard in modern JavaScript ecosystems.
Code Example
example.ts (single quotes)
const greeting = 'Hello, World!';
const user = {
name: 'Alice',
email: '[email protected]',
};
const template = 'Welcome, ' + user.name;
const message = `User: ${user.name}`;Key Benefits
- Less visual noise in code
- Requires fewer shift keystrokes
- Standard in Vue.js and many modern frameworks
- Enforced by StandardJS
- Used by most Node.js projects
- Cleaner HTML attribute writing
Statistics
Team Double Quotes
Traditional, familiar to backend developers, and emphasizes string values clearly.
Code Example
example.ts (double quotes)
const greeting = "Hello, World!";
const user = {
name: "Alice",
email: "[email protected]",
};
const template = "Welcome, " + user.name;
const message = `User: ${user.name}`;Key Benefits
- Familiar to most programmers
- Matches many other languages (Python, Java, C#)
- Clear visual distinction from single quotes
- Preferred in JSON and configuration files
- Used by Prettier's default configuration
- Common in backend TypeScript projects
Statistics
Additional Insights
More data points to help you make an informed decision for your team.
995
repositories analyzed