Skip to content

Double-quote and semicolon usage not in line with https://docs.cypress.io/ #1651

@MikeMcC399

Description

@MikeMcC399

Situation

Code formatting in this repo is done with a Prettier configuration file. In the case of the following configuration options, these are not defined in .prettierrc so Prettier defaults are used:

Config default https://docs.cypress.io/
semi true false
singleQuote false true

This means that code formatting in this repo is not aligned with the examples on the documentation website https://docs.cypress.io/ or with the default scaffolded Cypress test specs as shown on

End-to-End Testing > Your First Test

Image

Instead Cypress test specs, for example cypress/tests/ui/auth.spec.ts, use double-quotes and semicolons:

import { User } from "../../../src/models";
import { isMobile } from "../../support/utils";
const apiGraphQL = `${Cypress.env("apiUrl")}/graphql`;
describe("User Sign-up and Login", function () {
beforeEach(function () {
cy.task("db:seed");
cy.intercept("POST", "/users").as("signup");
cy.intercept("POST", apiGraphQL, (req) => {
const { body } = req;
if (body.hasOwnProperty("operationName") && body.operationName === "CreateBankAccount") {
req.alias = "gqlCreateBankAccountMutation";
}
});
});

Suggestion

Change the Prettier configuration file .prettierrc to

Config Before (default values) After
semi true false
singleQuote false true

to remove the use of semicolons and to use single quotes.

Then re-lint code using:

yarn run prettier

to align with these rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions