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 = {}) {
616
616
617
617
if ( cypress ) {
618
618
const cypressPlugin = require ( 'eslint-plugin-cypress/flat' ) ;
619
+ const chaiFriendlyPlugin = require ( 'eslint-plugin-chai-friendly' ) ;
619
620
config . push ( {
620
621
...cypressPlugin . configs . recommended ,
621
622
name : 'cypress' ,
623
+ plugins : {
624
+ ...cypressPlugin . configs . recommended . plugins ,
625
+ 'chai-friendly' : chaiFriendlyPlugin ,
626
+ } ,
622
627
files : [
623
628
`${ testsDir } /**/*.?(c|m)[jt]s` ,
624
629
'**/__tests__/**/*.?(c|m)[jt]s' ,
@@ -632,6 +637,10 @@ function customize(options: CustomizeOptions = {}) {
632
637
// Still when `this` context needs to be accessed, a dev can easily convert an arrow function to a regular function.
633
638
// This rule comes from our default config for `mocha`.
634
639
'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' ] ,
635
644
} ,
636
645
} ) ;
637
646
}
Original file line number Diff line number Diff line change 21
21
"@vitest/eslint-plugin" : " ^1.1.25" ,
22
22
"eslint" : " ^9.19.0" ,
23
23
"eslint-import-resolver-typescript" : " ^3.7.0" ,
24
+ "eslint-plugin-chai-friendly" : " ^1.0.1" ,
24
25
"eslint-plugin-check-file" : " ^2.8.0" ,
25
26
"eslint-plugin-cypress" : " ^4.1.0" ,
26
27
"eslint-plugin-import" : " npm:eslint-plugin-import-x@^4.6.1" ,
You can’t perform that action at this time.
0 commit comments