ihordiachenko / eslint-plugin-chai-friendly

Makes eslint friendly towards Chai.js 'expect' and 'should' statements.
MIT License
53 stars 10 forks source link

Errors with optional chaining operators #20

Closed urbanhusky closed 3 years ago

urbanhusky commented 3 years ago

When using chai-friendly/no-unused-expressions instead of the default no-unused-expressions, all code with optional chaining operators seems to fail with ESLint: Expected an assignment or function call and instead saw an expression. (@typescript-eslint/no-unused-expressions)

For example:

context.actions?.dispatch(…);

This renders the plugin unusable for me and I'm not sure if I could trust it to otherwise operate the same way and provide the same confidence in our code as eslint's no-unused-expressions.

ihordiachenko commented 3 years ago

Thank you for the report, @urbanhusky. Will look into it this weekend

ihordiachenko commented 3 years ago

Fixed in v0.7.1

urbanhusky commented 3 years ago

Seems to work fine now, thanks. I did have to change the rule overwrites from 'no-unused-expressions': 'off', to '@typescript-eslint/no-unused-expressions': 'off', to get it to work again though :)