Since HTML itself also happens to allow either double quotes or single quotes for delimiting attribute values, this kind of brings us back to the same debate. In the case of HTML attributes, however, I will always stick to double-quotes, since using single-quotes for attribute values is very uncommon and frankly just seems wrong.
Coding style tooling
- ESLint Getting Started Guide
- TypeScript ESLint: tooling for adding TypeScript-support to ESLint
- ESLint Integrations: locate the plugin for adding ESLint support to your favourite IDE
Add the rule
quotes: ['error', 'single'] to your .eslintrc.js to make ESLint enforce single quotes.
eslint -c .eslintrc.js --fix --ext .js ./
I can also highly recommend Prettier for maintaining a consistent coding style and fixing up existing source code.
Top comments (0)