- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.5k
Description
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
 
Instead Cypress test specs, for example cypress/tests/ui/auth.spec.ts, use double-quotes and semicolons:
cypress-realworld-app/cypress/tests/ui/auth.spec.ts
Lines 1 to 18 in d23eba8
| 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 prettierto align with these rules.