Skip to content

Commit

Permalink
Add single quote eslint rule (#1660)
Browse files Browse the repository at this point in the history
* Convert backticks to single quotes

* Format files
  • Loading branch information
laurakwhit authored Oct 2, 2023
1 parent 404db9c commit 5e14b40
Show file tree
Hide file tree
Showing 22 changed files with 108 additions and 106 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
$$Generic: 'readonly',
},
rules: {
quotes: ['error', 'single', { avoidEscape: true }],
'@typescript-eslint/no-unused-vars': [
'error',
{
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/event-history-empty-states.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ describe('Workflow Executions List', () => {
).as('event-history-ascending');
});

it(`should show an empty state in the feed view`, () => {
cy.visit(workflowUrl + `/history`);
it('should show an empty state in the feed view', () => {
cy.visit(workflowUrl + '/history');

cy.wait('@workflow-api');
cy.wait('@event-history-start');
Expand All @@ -52,8 +52,8 @@ describe('Workflow Executions List', () => {
cy.contains('No Events Match');
});

it(`should show an empty state in the compact view`, () => {
cy.visit(workflowUrl + `/history`);
it('should show an empty state in the compact view', () => {
cy.visit(workflowUrl + '/history');

cy.wait('@workflow-api');
cy.wait('@event-history-start');
Expand All @@ -80,7 +80,7 @@ describe('Workflow Executions List', () => {
{ fixture: 'event-history-with-no-activities.json' },
).as('event-history-ascending');

cy.visit(workflowUrl + `/history`);
cy.visit(workflowUrl + '/history');

cy.wait('@workflow-api');
cy.wait('@event-history-start');
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/login.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ describe('Login page', () => {

cy.wait('@settings-api');

cy.url().should('include', `/login`);
cy.url().should('include', '/login');

cy.get('[data-testid="login-title"]').contains('Welcome back.');
cy.get('[data-testid="login-info"]').contains(`Let's get you signed in.`);
cy.get('[data-testid="login-info"]').contains("Let's get you signed in.");
cy.get('[data-testid="login-button"]').contains('Continue to SSO');
});

Expand All @@ -31,6 +31,6 @@ describe('Login page', () => {
cy.wait('@namespaces-api');
cy.wait('@workflows-api');

cy.url().should('include', `/namespaces/default/workflows`);
cy.url().should('include', '/namespaces/default/workflows');
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/query.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Query', () => {

cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/default/workflows/*/runs/*/events/reverse*`,
'/api/v1/namespaces/default/workflows/*/runs/*/events/reverse*',
{ fixture: 'event-history-completed.json' },
).as('event-history-api');

Expand All @@ -31,7 +31,7 @@ describe('Query', () => {

cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/default/workflows/*/runs/*/query*`,
'/api/v1/namespaces/default/workflows/*/runs/*/query*',
{ fixture: 'query-java-error-unknown-type.json', statusCode: 400 },
).as('query-unknown-type-api');

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/task-queues.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Task Queues Page', () => {
beforeEach(() => {
cy.interceptApi();

cy.visit(`/namespaces/default/task-queues/a-task-queue`);
cy.visit('/namespaces/default/task-queues/a-task-queue');

cy.wait('@namespaces-api');
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/workflow-actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Workflow Actions', () => {
describe('Write Actions Disabled', () => {
beforeEach(() => {
cy.interceptApi();
cy.intercept(Cypress.env('VITE_API_HOST') + `/api/v1/settings?`, {
cy.intercept(Cypress.env('VITE_API_HOST') + '/api/v1/settings?', {
fixture: 'settings.write-actions-disabled.json',
}).as('settings-api');
cy.intercept(
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/workflow-executions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Workflow Executions List', () => {

for (const status of statuses) {
it(`should redirect to the correct query params for ${status} workflows`, () => {
cy.visit(`/namespaces/default/workflows`);
cy.visit('/namespaces/default/workflows');
cy.get('#execution-status-filter').select(status);
cy.get('#execution-status-filter').trigger('input');
cy.url().should(
Expand All @@ -83,7 +83,7 @@ describe('Workflow Executions List', () => {

cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/default/workflows/*/runs/*/events/reverse*`,
'/api/v1/namespaces/default/workflows/*/runs/*/events/reverse*',
{ fixture: 'event-history-completed.json' },
).as('event-history-api');

Expand All @@ -103,7 +103,7 @@ describe('Workflow Executions List', () => {
cy.get('#execution-status-filter').trigger('input');
cy.url().should(
'contain',
encodeURIComponent(`ExecutionStatus="Running"`),
encodeURIComponent('ExecutionStatus="Running"'),
);

cy.get('.workflow-summary-row a').first().click();
Expand All @@ -116,7 +116,7 @@ describe('Workflow Executions List', () => {

cy.url().should(
'contain',
encodeURIComponent(`ExecutionStatus="Running"`),
encodeURIComponent('ExecutionStatus="Running"'),
);
cy.get('#execution-status-filter')
.find('option:selected')
Expand Down
30 changes: 15 additions & 15 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ Cypress.Commands.add('interceptSearchAttributesApi', () => {

Cypress.Commands.add('interceptWorkflowsApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') + `/api/v1/namespaces/*/workflows?query=*`,
Cypress.env('VITE_API_HOST') + '/api/v1/namespaces/*/workflows?query=*',
{ fixture: 'workflows.json' },
).as('workflows-api');
});

Cypress.Commands.add('interceptWorkflowsCountApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/workflows/count?query=*`,
'/api/v1/namespaces/*/workflows/count?query=*',
{ fixture: 'workflows-count.json' },
).as('workflows-count-api');
});
Expand Down Expand Up @@ -86,7 +86,7 @@ Cypress.Commands.add('interceptClusterApi', (fixture = 'cluster.json') => {
Cypress.Commands.add('interceptArchivedWorkflowsApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/workflows/archived?query=*`,
'/api/v1/namespaces/*/workflows/archived?query=*',
{ fixture: 'workflows.json' },
).as('workflows-archived-api');
});
Expand All @@ -107,23 +107,23 @@ Cypress.Commands.add('interceptGithubReleasesApi', () => {
Cypress.Commands.add('interceptQueryApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/workflows/*/runs/*/query*`,
'/api/v1/namespaces/*/workflows/*/runs/*/query*',
{ fixture: 'query-stack-trace.json' },
).as('query-api');
});

Cypress.Commands.add('interceptTaskQueuesApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/task-queues/*?taskQueueType=1`,
'/api/v1/namespaces/*/task-queues/*?taskQueueType=1',
{
fixture: 'worker-task-queues.json',
},
).as('worker-task-queues-api');

cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/task-queues/*?taskQueueType=2`,
'/api/v1/namespaces/*/task-queues/*?taskQueueType=2',
{
fixture: 'activity-task-queues.json',
},
Expand All @@ -133,68 +133,68 @@ Cypress.Commands.add('interceptTaskQueuesApi', () => {
Cypress.Commands.add('interceptTaskQueueCompatibilityApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/task-queues/*/compatibility`,
'/api/v1/namespaces/*/task-queues/*/compatibility',
{ fixture: 'compatibility.json' },
).as('compatibility-api');
});

Cypress.Commands.add('interceptSchedulesApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') + `/api/v1/namespaces/*/schedules*`,
Cypress.env('VITE_API_HOST') + '/api/v1/namespaces/*/schedules*',
{ fixture: 'schedules.json' },
).as('schedules-api');
});

Cypress.Commands.add('interceptScheduleApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') + `/api/v1/namespaces/*/schedules/*`,
Cypress.env('VITE_API_HOST') + '/api/v1/namespaces/*/schedules/*',
{ fixture: 'schedule.json' },
).as('schedule-api');
});

Cypress.Commands.add('interceptCreateBatchOperationApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') + `/api/v1/namespaces/*/batch-operations?`,
Cypress.env('VITE_API_HOST') + '/api/v1/namespaces/*/batch-operations?',
{ statusCode: 200, body: {} },
).as('create-batch-operation-api');
});

Cypress.Commands.add('interceptDescribeBatchOperationApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/batch-operations/describe?jobId=*`,
'/api/v1/namespaces/*/batch-operations/describe?jobId=*',
{ fixture: 'batch-operation-status.json' },
).as('describe-batch-operation-api');
});

Cypress.Commands.add('interceptTerminateWorkflowApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/workflows/*/runs/*/terminate?`,
'/api/v1/namespaces/*/workflows/*/runs/*/terminate?',
{ statusCode: 200, body: {} },
).as('terminate-workflow-api');
});

Cypress.Commands.add('interceptCancelWorkflowApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/workflows/*/runs/*/cancel?`,
'/api/v1/namespaces/*/workflows/*/runs/*/cancel?',
{ statusCode: 200, body: {} },
).as('cancel-workflow-api');
});

Cypress.Commands.add('interceptSignalWorkflowApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/workflows/*/runs/*/signal?`,
'/api/v1/namespaces/*/workflows/*/runs/*/signal?',
{ statusCode: 200, body: {} },
).as('signal-workflow-api');
});

Cypress.Commands.add('interceptResetWorkflowApi', () => {
cy.intercept(
Cypress.env('VITE_API_HOST') +
`/api/v1/namespaces/*/workflows/*/runs/*/reset?`,
'/api/v1/namespaces/*/workflows/*/runs/*/reset?',
{ statusCode: 200, body: { runId: 'abc-123' } },
).as('reset-workflow-api');
});
Expand Down
2 changes: 1 addition & 1 deletion scripts/download-temporal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ try {

if (!response.ok) {
console.warn(
chalk.magenta.bold(`There was an error fetching Temporal CLI`),
chalk.magenta.bold('There was an error fetching Temporal CLI'),
chalk.bgRed.white.bold(` ${response.status} (${response.statusText}) `),
chalk.cyan('Skipping…'),
);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/event/event-history-timeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
return `<div class="flex gap-2 items-center">${groupName}</div>`;
}
function renderExecutionName() {
return `<div class="flex gap-1 items-center">Workflow Execution</div>`;
return '<div class="flex gap-1 items-center">Workflow Execution</div>';
}
function renderPendingAttempts(name, attempt) {
const retryIcon = renderComponentToHTML(Icon, {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/i18n/locales/en/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ export const Strings = {
'Try adjusting or clearing the filters to see the Workflows running on this Namespace.',
'workflow-query-error-state': 'There is an error with filtering Workflows.',
'workflow-empty-state-title': 'No Workflows running in this Namespace',
'workflow-empty-state-description': `You can populate the Web UI with sample Workflows. You can find a complete list of executable code samples at`,
'workflow-empty-state-description':
'You can populate the Web UI with sample Workflows. You can find a complete list of executable code samples at',
'visibility-disabled-archival':
'This namespace is currently enabled for archival but visibility is not enabled.',
'archival-link-preface': 'To enable ',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const settings = settingsFixture as unknown as Settings;
const accessToken = 'access-token';

describe('toDecodedPendingActivities', () => {
it(`should decode heartbeatDetails`, async () => {
it('should decode heartbeatDetails', async () => {
const workflow = pendingActivityWorkflow as unknown as WorkflowExecution;
const decodedHeartbeatDetails = await toDecodedPendingActivities(
workflow,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/workflow-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const fetchAllWorkflows = async (
err?.body?.message ??
`Error fetching workflows: ${err.status}: ${err.statusText}`;
} else {
error = `Error fetching workflows: Server failed to respond`;
error = 'Error fetching workflows: Server failed to respond';
}
};

Expand Down
10 changes: 5 additions & 5 deletions src/lib/utilities/event-formatting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('getDateFilterValue', () => {
const showElapsed = 'false';
const options = { compact, sortOrder, showElapsed };

const value = `ascending:false`;
const value = 'ascending:false';
expect(getDateFilterValue(options)).toBe(value);
});

Expand All @@ -35,7 +35,7 @@ describe('getDateFilterValue', () => {
const showElapsed = 'true';
const options = { compact, sortOrder, showElapsed };

const value = `descending:true`;
const value = 'descending:true';
expect(getDateFilterValue(options)).toBe(value);
});

Expand All @@ -46,7 +46,7 @@ describe('getDateFilterValue', () => {
const showElapsed = 'true';
const options = { compact, sortOrder, showElapsed };

const value = `ascending:true`;
const value = 'ascending:true';
expect(getDateFilterValue(options)).toBe(value);
});

Expand All @@ -56,7 +56,7 @@ describe('getDateFilterValue', () => {
const showElapsed = 'false';
const options = { compact, sortOrder, showElapsed };

const value = `ascending:false`;
const value = 'ascending:false';
expect(getDateFilterValue(options)).toBe(value);
});

Expand All @@ -67,7 +67,7 @@ describe('getDateFilterValue', () => {
const showElapsed = 'true';
const options = { compact, sortOrder, showElapsed };

const value = `ascending:true`;
const value = 'ascending:true';
expect(getDateFilterValue(options)).toBe(value);
});
});
6 changes: 3 additions & 3 deletions src/lib/utilities/is.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@ describe('isSpace', () => {

describe('isQuote', () => {
it('should return true for a single quote', () => {
expect(isQuote(`'`)).toBe(true);
expect(isQuote("'")).toBe(true);
});

it('should return true for a single quote', () => {
expect(isQuote(`"`)).toBe(true);
expect(isQuote('"')).toBe(true);
});

it('should return false for a letter', () => {
expect(isQuote(`a`)).toBe(false);
expect(isQuote('a')).toBe(false);
});

it('should return false for null', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utilities/route-for.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ describe('routeFor SSO authentication ', () => {

const ssoUrl = new URL(sso);
expect(ssoUrl.searchParams.get('returnUrl')).toBe(
`https://localhost/some/path`,
'https://localhost/some/path',
);
});

Expand Down
Loading

0 comments on commit 5e14b40

Please sign in to comment.