Skip to content

Commit

Permalink
style(#eslint, #zimic): prefer single quotes (#465)
Browse files Browse the repository at this point in the history
Added the ESLint rule `quotes: ['warn', 'single', { avoidEscape: true,
allowTemplateLiterals: false }],` to enforce single quotes when
possible.
  • Loading branch information
diego-aquino authored Nov 5, 2024
1 parent 9672e96 commit 8549f39
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
'no-array-constructor': 'off',
'array-callback-return': 'warn',
eqeqeq: 'warn',
quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
'no-constructor-return': 'error',
'no-catch-shadow': 'error',
'no-cond-assign': 'warn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export async function declareRestrictionsHttpInterceptorTests(options: RuntimeSh
headers.set('accept', 'application/json');
headers.set('content-language', 'pt');

promise = fetch(joinURL(baseURL, `/users`), { method, headers });
promise = fetch(joinURL(baseURL, '/users'), { method, headers });
await expectFetchErrorOrPreflightResponse(promise, {
shouldBePreflight: overridesPreflightResponse,
});
Expand Down Expand Up @@ -600,7 +600,7 @@ export async function declareRestrictionsHttpInterceptorTests(options: RuntimeSh
new HttpSearchParams<SearchParamsSchema>(),
undefined,
]) {
const promise = fetch(joinURL(baseURL, `/users?tag=admin`), {
const promise = fetch(joinURL(baseURL, '/users?tag=admin'), {
method,
body,
});
Expand Down Expand Up @@ -679,7 +679,7 @@ export async function declareRestrictionsHttpInterceptorTests(options: RuntimeSh
new HttpSearchParams<SearchParamsSchema>(),
undefined,
]) {
const promise = fetch(joinURL(baseURL, `/users?tag=admin`), {
const promise = fetch(joinURL(baseURL, '/users?tag=admin'), {
method,
body,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SERVICE_WORKER_FILE_NAME } from '@/cli/browser/shared/constants';
class UnregisteredBrowserServiceWorkerError extends Error {
constructor() {
super(
`Failed to register the browser service worker: ` +
'Failed to register the browser service worker: ' +
`script '${window.location.origin}/${SERVICE_WORKER_FILE_NAME}' not found.\n\n` +
'Did you forget to run `zimic browser init <publicDirectory>`?\n\n' +
'Learn more: https://github.com/zimicjs/zimic/wiki/getting‐started#client-side-post-install',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export function declareRestrictionHttpRequestHandlerTests(
new HttpSearchParams<SearchParamsSchema>({ name }),
new HttpSearchParams<SearchParamsSchema>({ name: `Other ${name}` }),
new HttpSearchParams<SearchParamsSchema>({ other: 'param' }),
new HttpSearchParams<SearchParamsSchema>({ other: `Other param` }),
new HttpSearchParams<SearchParamsSchema>({ other: 'Other param' }),
new HttpSearchParams<SearchParamsSchema>({}),
];

Expand Down

0 comments on commit 8549f39

Please sign in to comment.