This rule enforces the use of specific presets when setting cypress viewport, or disallows them entirely.
Examples of incorrect code for this rule:
/*eslint saxo/cy-viewport-presets: ["error", { allowed: ['phone', 'tablet', 'desktop'] }*/
cy.viewport('iphone-6');
/*eslint saxo/cy-viewport-presets: "error"*/
cy.viewport('phone');
Examples of correct code for this rule:
/*eslint saxo/cy-viewport-presets: ["error", { allowed: ['phone', 'tablet', 'desktop'] }*/
cy.viewport('phone', 'landscape');
/*eslint saxo/cy-viewport-presets: ["error", { allowed: ['tablet'] }*/
cy.viewport('tablet');
This rule has an object option, containing one property.
'allowed' contains the presets to enforce. If the array is empty, presets are disallowed.