Skip to content

Commit 29a02fb

Browse files
authored
feat: apply stylistic recommended rules to examples (#966)
1 parent fda861b commit 29a02fb

File tree

10 files changed

+29
-29
lines changed

10 files changed

+29
-29
lines changed

app/commands/actions.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ <h4 id="type"><a href="https://on.cypress.io/type">.type()</a></h4>
8282
cy.get('.action-email').type('{del}{selectall}{backspace}')
8383

8484
// .type() with key modifiers
85-
cy.get('.action-email').type('{alt}{option}') //these are equivalent
86-
cy.get('.action-email').type('{ctrl}{control}') //these are equivalent
87-
cy.get('.action-email').type('{meta}{command}{cmd}') //these are equivalent
85+
cy.get('.action-email').type('{alt}{option}') // these are equivalent
86+
cy.get('.action-email').type('{ctrl}{control}') // these are equivalent
87+
cy.get('.action-email').type('{meta}{command}{cmd}') // these are equivalent
8888
cy.get('.action-email').type('{shift}')
8989

9090
// Delay each keypress by 0.1 sec
@@ -182,7 +182,7 @@ <h4 id="submit"><a href="https://on.cypress.io/submit">.submit()</a></h4>
182182
<p>To submit a form, use the <a href="https://on.cypress.io/submit"><code>cy.submit()</code></a> command.</p>
183183
<pre><code class="javascript">cy.get('.action-form')
184184
.find('[type="text"]').type('HALFOFF')
185-
185+
186186
cy.get('.action-form').submit()
187187
cy.get('.action-form').next().should('contain', 'Your form has been submitted!')</code></pre>
188188
</div>

app/commands/misc.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ <h4 id="exec"><a href="https://on.cypress.io/exec">cy.exec()</a></h4>
123123
if (Cypress.platform === 'win32') {
124124
cy.exec('print cypress.config.js')
125125
.its('stderr').should('be.empty')
126-
} else {
126+
}
127+
else {
127128
cy.exec('cat cypress.config.js')
128129
.its('stderr').should('be.empty')
129130

app/commands/storage.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ <h4><a href="https://on.cypress.io/getalllocalstorage">cy.getAllLocalStorage()</
141141
expect(storageMap).to.deep.equal({
142142
// other origins will also be present if localStorage is set on them
143143
'http://localhost:8080': {
144-
'prop1': 'red',
145-
'prop2': 'blue',
146-
'prop3': 'magenta',
144+
prop1: 'red',
145+
prop2: 'blue',
146+
prop3: 'magenta',
147147
},
148148
})
149149
})</code></pre>
@@ -191,9 +191,9 @@ <h4><a href="https://on.cypress.io/getallsessionstorage">cy.getAllSessionStorage
191191
expect(storageMap).to.deep.equal({
192192
// other origins will also be present if sessionStorage is set on them
193193
'http://localhost:8080': {
194-
'prop4': 'cyan',
195-
'prop5': 'yellow',
196-
'prop6': 'black',
194+
prop4: 'cyan',
195+
prop5: 'yellow',
196+
prop6: 'black',
197197
},
198198
})
199199
})</code></pre>

cypress.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
'projectId': '4b7344',
2+
projectId: '4b7344',
33
e2e: {},
44
}

cypress/e2e/2-advanced-examples/actions.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ context('Actions', () => {
1717
cy.get('.action-email').type('{del}{selectall}{backspace}')
1818

1919
// .type() with key modifiers
20-
cy.get('.action-email').type('{alt}{option}') //these are equivalent
21-
cy.get('.action-email').type('{ctrl}{control}') //these are equivalent
22-
cy.get('.action-email').type('{meta}{command}{cmd}') //these are equivalent
20+
cy.get('.action-email').type('{alt}{option}') // these are equivalent
21+
cy.get('.action-email').type('{ctrl}{control}') // these are equivalent
22+
cy.get('.action-email').type('{meta}{command}{cmd}') // these are equivalent
2323
cy.get('.action-email').type('{shift}')
2424

2525
// Delay each keypress by 0.1 sec

cypress/e2e/2-advanced-examples/cypress_api.cy.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/// <reference types="cypress" />
22

33
context('Cypress APIs', () => {
4-
54
context('Cypress.Commands', () => {
65
beforeEach(() => {
76
cy.visit('http://localhost:8080/cypress-api')

cypress/e2e/2-advanced-examples/misc.cy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ context('Misc', () => {
4343
if (Cypress.platform === 'win32') {
4444
cy.exec(`print ${Cypress.config('configFile')}`)
4545
.its('stderr').should('be.empty')
46-
} else {
46+
}
47+
else {
4748
cy.exec(`cat ${Cypress.config('configFile')}`)
4849
.its('stderr').should('be.empty')
4950

cypress/e2e/2-advanced-examples/storage.cy.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ context('Local Storage / Session Storage', () => {
6464
expect(storageMap).to.deep.equal({
6565
// other origins will also be present if localStorage is set on them
6666
'http://localhost:8080': {
67-
'prop1': 'red',
68-
'prop2': 'blue',
69-
'prop3': 'magenta',
67+
prop1: 'red',
68+
prop2: 'blue',
69+
prop3: 'magenta',
7070
},
7171
})
7272
})
@@ -94,9 +94,9 @@ context('Local Storage / Session Storage', () => {
9494
expect(storageMap).to.deep.equal({
9595
// other origins will also be present if sessionStorage is set on them
9696
'http://localhost:8080': {
97-
'prop4': 'cyan',
98-
'prop5': 'yellow',
99-
'prop6': 'black',
97+
prop4: 'cyan',
98+
prop5: 'yellow',
99+
prop6: 'black',
100100
},
101101
})
102102
})

eslint.config.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ export default [
1010
...eslintPluginJsonc.configs['flat/recommended-with-json'],
1111
mochaPlugin.configs.recommended,
1212
pluginCypress.configs.recommended,
13+
stylistic.configs.recommended,
1314
{
14-
ignores: ['app/assets/js/vendor/'],
15+
ignores: ['app/assets/js/{vendor,todo}/'],
1516
},
1617
{
17-
plugins: {
18-
'@stylistic': stylistic,
19-
},
2018
rules: {
21-
'@stylistic/indent': ['error', 2, { 'SwitchCase': 1, 'MemberExpression': 'off' }],
19+
'@stylistic/arrow-parens': ['error', 'always'],
2220
'@stylistic/comma-dangle': ['error', 'always-multiline'],
21+
'@stylistic/indent': ['error', 2, { SwitchCase: 1, MemberExpression: 'off' }],
2322
'@stylistic/quotes': ['error', 'single'],
2423
'@stylistic/semi': ['error', 'never'],
24+
'@stylistic/space-before-function-paren': ['error', 'always'],
2525
'mocha/no-exclusive-tests': 'error',
2626
'mocha/no-pending-tests': 'error',
2727
'mocha/no-mocha-arrows': 'off',

scripts/set-port.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const newUrl = `localhost:${process.env.PORT}`
2626

2727
console.log('replacing "%s" with "%s" in all spec files', input, newUrl)
2828

29-
3029
const getSpecFilenames = () => {
3130
const globby = require('globby')
3231

0 commit comments

Comments
 (0)