Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Latest commit

 

History

History
44 lines (34 loc) · 1.05 KB

cy-viewport-max.md

File metadata and controls

44 lines (34 loc) · 1.05 KB

Enforce a limit on cypress viewport size

cy-viewport-max

This rule enforces a limit on cypress viewport size. It does not account for identifiers.

Rule Details

Examples of incorrect code for this rule:

/*eslint saxo/cy-viewport-max: ["error", { maxWidth: 1600, maxHeight: 1160 }]*/
cy.viewport(1600, 1260);
/*eslint saxo/cy-viewport-max: ["error", { maxWidth: 1600 }]*/
cy.viewport(1700, 1160);
/*eslint saxo/cy-viewport-max: ["error", { maxHeight: 1160 }]*/
cy.viewport(1600, 1700);

Examples of correct code for this rule:

/*eslint saxo/cy-viewport-max: ["error", { maxWidth: 1600, maxHeight: 1160 }]*/
cy.viewport(1600, 1160);
/*eslint saxo/cy-viewport-max: ["error", { maxWidth: 1600 }]*/
cy.viewport(1600, 1160);
/*eslint saxo/cy-viewport-max: ["error", { maxHeight: 1160 }]*/
cy.viewport(1600, 1160);

Options

This rule has an object option, containing two properties.

'maxWidth' enforces a limit on the height of the viewport. 'maxHeight' enforces a limit on the width of the viewport.