Skip to content

Commit

Permalink
feat: Add no-debug rule to cypress config, update eslint-plugin-cyp…
Browse files Browse the repository at this point in the history
…ress to ~3.5.0 (#116)

* fix(deps): update dependency eslint-plugin-cypress to ~3.5.0

* feat: Add no-debug to cypress

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bartosz <burtekdotryw@gmail.com>
  • Loading branch information
renovate[bot] and burtek committed Aug 22, 2024
1 parent 18f90e3 commit 0954aef
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
36 changes: 20 additions & 16 deletions configs/cypress.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
import cypress from 'eslint-plugin-cypress/flat';
import tseslint from 'typescript-eslint';

import { extendFlatConfig } from './share/extend-flat-config.js';


const files = ['**/*.cy.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'];

export function prepareConfig() {
return tseslint.config(
{
...cypress.configs.recommended,
name: 'dtrw:cypress:base',
files,
rules: {
...cypress.configs.recommended.rules,
'cypress/assertion-before-screenshot': 'warn',
'cypress/no-force': 'warn',
'cypress/no-async-before': 'error',
'cypress/no-pause': 'error',
extendFlatConfig(
cypress.configs.recommended,
{
name: 'dtrw:cypress:base',
files,
rules: {
'cypress/assertion-before-screenshot': 'warn',
'cypress/no-force': 'warn',
'cypress/no-async-before': 'error',
'cypress/no-debug': 'error',
'cypress/no-pause': 'error',

// chai-friendly
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
// eslint-disable-next-line no-warning-comments
// TODO: fork of those above based on https://github.com/ihordiachenko/eslint-plugin-chai-friendly/blob/master/lib/rules/no-unused-expressions.js
// chai-friendly
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
// eslint-disable-next-line no-warning-comments
// TODO: fork of those above based on https://github.com/ihordiachenko/eslint-plugin-chai-friendly/blob/master/lib/rules/no-unused-expressions.js
}
}
}
)
);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@next/eslint-plugin-next": "~14.2.2",
"@stylistic/eslint-plugin": "~2.6.0",
"eslint-import-resolver-typescript": "~3.6.1",
"eslint-plugin-cypress": "~3.4.0",
"eslint-plugin-cypress": "~3.5.0",
"eslint-plugin-import": "~2.29.1",
"eslint-plugin-jest": "~28.8.0",
"eslint-plugin-jest-dom": "~5.4.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2477,10 +2477,10 @@ eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0:
dependencies:
debug "^3.2.7"

eslint-plugin-cypress@~3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-3.4.0.tgz#6a7f508cda7579184265b50129b853e0c06c9944"
integrity sha512-Rrrr3Ri6wHqzrRr+TyUV7bDS4UnMMrFY1R1PP2F7XdGfe9txDC6lQEshyoNOWqGoPkbbeDm1x1XPc/adxemsnA==
eslint-plugin-cypress@~3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-3.5.0.tgz#380ef5049ad80ebeca923db69e4aa96e72fcd893"
integrity sha512-JZQ6XnBTNI8h1B9M7wJSFzc48SYbh7VMMKaNTQOFa3BQlnmXPrVc4PKen8R+fpv6VleiPeej6VxloGb42zdRvw==
dependencies:
globals "^13.20.0"

Expand Down

0 comments on commit 0954aef

Please sign in to comment.