String Literals in JavaScript: Should I Use Double-quotes or Single-quotes?

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Scout APM - Less time debugging, more time building
  • JetBrains - Developer Ecosystem Survey 2022
  • SonarQube - Static code analysis for 29 languages.
  • prettier

    Prettier is an opinionated code formatter.

    I can also highly recommend Prettier for maintaining a consistent coding style and fixing up existing source code.

  • React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

    Looking at some popular JavaScript projects on GitHub, I noted that react, moment, and express all use single quotes for strings. However, another popular project, tslib, uses double quotes 🙄. So, while it would seem that single quotes is more common, this metric is not entirely conclusive.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • ESLint

    Find and fix problems in your JavaScript code.

    Now, regardless of whether you are decided on using single quotes or double quotes in JavaScript, the more important issue is applying your convention consistently throughout the code base. ESLint is one tool that will help a great deal in enforcing a consistent coding style. You supply it with a config file specifying a list of rules describing your coding conventions, and it will indicate where your code is not conforming to the specified rules. See the following links to get started:

  • moment

    Parse, validate, manipulate, and display dates in javascript.

    Looking at some popular JavaScript projects on GitHub, I noted that react, moment, and express all use single quotes for strings. However, another popular project, tslib, uses double quotes 🙄. So, while it would seem that single quotes is more common, this metric is not entirely conclusive.

  • Express

    Fast, unopinionated, minimalist web framework for node.

    Looking at some popular JavaScript projects on GitHub, I noted that react, moment, and express all use single quotes for strings. However, another popular project, tslib, uses double quotes 🙄. So, while it would seem that single quotes is more common, this metric is not entirely conclusive.

  • tslib

    Runtime library for TypeScript helpers.

    Looking at some popular JavaScript projects on GitHub, I noted that react, moment, and express all use single quotes for strings. However, another popular project, tslib, uses double quotes 🙄. So, while it would seem that single quotes is more common, this metric is not entirely conclusive.

  • typescript-eslint

    :sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

    TypeScript ESLint: tooling for adding TypeScript-support to ESLint

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts