Skip to content

Commit

Permalink
style: pre-commit eslint manual fixes.
Browse files Browse the repository at this point in the history
Fix several errors reported by eslint. The false/positive reports in the examples are ignored.
  • Loading branch information
MichaelsJP authored and TheGreatRefrigerator committed Dec 9, 2022
1 parent b6626ab commit 76569c4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/2-advanced-examples/cypress_api.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ context('Cypress.Commands', () => {
return subject
})

// eslint-disable-next-line no-unused-vars
cy.get('button').console('info').then(($button) => {
// subject is still $button
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/2-advanced-examples/utilities.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ context('Utilities', () => {
*/
function waitOneSecond () {
// return a promise that resolves after 1 second
return new Cypress.Promise((resolve, reject) => {
return new Cypress.Promise((resolve) => {
setTimeout(() => {
// set waited to true
waited = true
Expand Down
13 changes: 12 additions & 1 deletion cypress/e2e/2-advanced-examples/viewport.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,44 @@ context('Viewport', () => {

// We added a cy.wait() between each viewport change so you can see
// the change otherwise it is a little too fast to see :)

cy.viewport('macbook-15')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('macbook-13')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('macbook-11')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('ipad-2')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('ipad-mini')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('iphone-6+')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('iphone-6')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('iphone-5')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('iphone-4')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('iphone-3')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)

// cy.viewport() accepts an orientation for all presets
// the default orientation is 'portrait'
cy.viewport('ipad-2', 'portrait')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)
cy.viewport('iphone-4', 'landscape')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200)

// The viewport will be reset back to the default dimensions
Expand Down
3 changes: 3 additions & 0 deletions cypress/e2e/2-advanced-examples/waiting.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ context('Waiting', () => {
// https://on.cypress.io/wait
it('cy.wait() - wait for a specific amount of time', () => {
cy.get('.wait-input1').type('Wait 1000ms after typing')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000)
cy.get('.wait-input2').type('Wait 1000ms after typing')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000)
cy.get('.wait-input3').type('Wait 1000ms after typing')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default {
*/
calculateIsochrones () {
const context = this
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
const places = context.getFilledPlaces()

if (places.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default {
highlighData.sections.push(segmentData)
this.eventBus.$emit('highlightPolylineSections', highlighData)
},
buildExtraHighlighPolylineData (step, index) {
buildExtraHighlighPolylineData (step) {
const color = constants.segmentHighlightColor
const label = step.instruction.replace(/<(?:.|\n)*?>/gm, '')
const intervals = [step.way_points]
Expand Down

0 comments on commit 76569c4

Please sign in to comment.