You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Popular test frameworks like Mocha, Jasmine, and Jest encourage having many anonymous functions with assertions instead of return values. While this is inherently not a very functional paradigm, many functional libraries still use these test frameworks and it can be inconvenient to batch disable many rules at once.
Possible solutions
Tell users to disable eslint in the test directory with an .eslintignore file. This is pretty drastic, but if we agree on this it wouldn't require any changes.
Provide a configuration that's similar to recommended, but friendlier to anonymous functions with assertions. This could disable rules like no-nil and no-unused-expressions. Users would then switch to this configuration only for test directories.
The text was updated successfully, but these errors were encountered:
Thanks for the link. I've used applicatives in Haskell, and while it's a great pattern for general purpose pure functional programming, I'm concerned that this works against the much more imperative styles of almost all popular JavaScript testing frameworks (Mocha, Jasmine, Jest, Ava, Tape). I could use this pattern in my implementation, but I would need to use a test framework that only uses applicatives and pure results (which as far as I'm aware doesn't exist yet, though I've been experimenting with one. One could write their own testing infrastructure from scratch to meet these rules, but I feel like that's a lot of work for a linting library to impose.
What do you think about my possible solutions? I just converted them to a numbered list.
Popular test frameworks like Mocha, Jasmine, and Jest encourage having many anonymous functions with assertions instead of return values. While this is inherently not a very functional paradigm, many functional libraries still use these test frameworks and it can be inconvenient to batch disable many rules at once.
Possible solutions
.eslintignore
file. This is pretty drastic, but if we agree on this it wouldn't require any changes.recommended
, but friendlier to anonymous functions with assertions. This could disable rules likeno-nil
andno-unused-expressions
. Users would then switch to this configuration only for test directories.The text was updated successfully, but these errors were encountered: