Problem
The @stylistic/quotes ESLint rule is configured as ['error', 'single'], which defaults to avoidEscape: false. This means ESLint always requires single quotes, even for strings that contain single quotes (which would require escaping).
Prettier is configured with "singleQuote": true, but Prettier unconditionally switches to double quotes when a string contains single quotes, to avoid escaping. This creates a persistent conflict:
- Pre-commit lint-staged runs
eslint --fix (converts to single-quoted with escaping), then prettier --write (reverts to double-quoted)
- Committed code has double-quoted strings
- CI
lint:eslint fails with Strings must use singlequote @stylistic/quotes
This has been observed in src/services/node.logic.service.ts and previously in src/app.controller.ts and src/repositories/configuration/simulation-logs.repository.ts.
Fix
Change the @stylistic/quotes rule in eslint.config.mjs to include avoidEscape: true:
- '@stylistic/quotes': ['error', 'single'],
+ '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
This aligns ESLint with Prettier's behaviour - both tools will agree that strings containing single quotes may use double quotes. The same fix has already been applied to the frmscoe/rule-* modules.
Acceptance criteria
eslint.config.mjs has '@stylistic/quotes': ['error', 'single', { avoidEscape: true }]
npm run lint:eslint passes on all active feature branches without manual quote escaping
- No regression on existing single-quote enforcement for strings that do not contain single quotes
Problem
The
@stylistic/quotesESLint rule is configured as['error', 'single'], which defaults toavoidEscape: false. This means ESLint always requires single quotes, even for strings that contain single quotes (which would require escaping).Prettier is configured with
"singleQuote": true, but Prettier unconditionally switches to double quotes when a string contains single quotes, to avoid escaping. This creates a persistent conflict:eslint --fix(converts to single-quoted with escaping), thenprettier --write(reverts to double-quoted)lint:eslintfails withStrings must use singlequote @stylistic/quotesThis has been observed in
src/services/node.logic.service.tsand previously insrc/app.controller.tsandsrc/repositories/configuration/simulation-logs.repository.ts.Fix
Change the
@stylistic/quotesrule ineslint.config.mjsto includeavoidEscape: true:This aligns ESLint with Prettier's behaviour - both tools will agree that strings containing single quotes may use double quotes. The same fix has already been applied to the
frmscoe/rule-*modules.Acceptance criteria
eslint.config.mjshas'@stylistic/quotes': ['error', 'single', { avoidEscape: true }]npm run lint:eslintpasses on all active feature branches without manual quote escaping