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

Latest commit

 

History

History
39 lines (30 loc) · 822 Bytes

cy-viewport-literals.md

File metadata and controls

39 lines (30 loc) · 822 Bytes

Enforce literals as cypress viewport parameters

cy-viewport-literals

This rule enforces literals when setting cypress viewport.

Rule Details

Examples of incorrect code for this rule:

/*eslint saxo/cy-viewport-no-identifiers: "error"*/
cy.viewport(height, 1260);
/*eslint saxo/cy-viewport-no-identifiers: "error"*/
cy.viewport(preset, 'landscape');
/*eslint saxo/cy-viewport-no-identifiers: "error"*/
cy.viewport('macbook-13', orientation);

Examples of correct code for this rule:

/*eslint saxo/cy-viewport-no-identifiers: "error"*/
cy.viewport('macbook-13', 'landscape', options);
/*eslint saxo/cy-viewport-no-identifiers: "error"*/
cy.viewport(1600, 1160, options);
/*eslint saxo/cy-viewport-no-identifiers: "error"*/
cy.viewport('macbook-13');