File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -616,9 +616,14 @@ function customize(options: CustomizeOptions = {}) {
616616
617617 if ( cypress ) {
618618 const cypressPlugin = require ( 'eslint-plugin-cypress/flat' ) ;
619+ const chaiFriendlyPlugin = require ( 'eslint-plugin-chai-friendly' ) ;
619620 config . push ( {
620621 ...cypressPlugin . configs . recommended ,
621622 name : 'cypress' ,
623+ plugins : {
624+ ...cypressPlugin . configs . recommended . plugins ,
625+ 'chai-friendly' : chaiFriendlyPlugin ,
626+ } ,
622627 files : [
623628 `${ testsDir } /**/*.?(c|m)[jt]s` ,
624629 '**/__tests__/**/*.?(c|m)[jt]s' ,
@@ -632,6 +637,10 @@ function customize(options: CustomizeOptions = {}) {
632637 // Still when `this` context needs to be accessed, a dev can easily convert an arrow function to a regular function.
633638 // This rule comes from our default config for `mocha`.
634639 'mocha/no-mocha-arrows' : 'off' ,
640+ // allow 'expect(foo).to.be.true' https://github.com/ihordiachenko/eslint-plugin-chai-friendly
641+ 'no-unused-expressions' : 'off' ,
642+ '@typescript-eslint/no-unused-expressions' : 'off' ,
643+ 'chai-friendly/no-unused-expressions' : shared [ 'no-unused-expressions' ] ,
635644 } ,
636645 } ) ;
637646 }
Original file line number Diff line number Diff line change 2121 "@vitest/eslint-plugin" : " ^1.1.25" ,
2222 "eslint" : " ^9.19.0" ,
2323 "eslint-import-resolver-typescript" : " ^3.7.0" ,
24+ "eslint-plugin-chai-friendly" : " ^1.0.1" ,
2425 "eslint-plugin-check-file" : " ^2.8.0" ,
2526 "eslint-plugin-cypress" : " ^4.1.0" ,
2627 "eslint-plugin-import" : " npm:eslint-plugin-import-x@^4.6.1" ,
You can’t perform that action at this time.
0 commit comments