Repository navigation
Do not break long it calls - #842
Conversation
| n.arguments.length === 2 && | ||
| (n.arguments[0].type === "StringLiteral" || n.arguments[0].type === "Literal" && typeof n.arguments[0].value === "string") && | ||
| (n.arguments[1].type === "FunctionExpression" || n.arguments[1].type === "ArrowFunctionExpression") && | ||
| n.arguments[1].params.length <= 1 |
There was a problem hiding this comment.
I'm a little hesitant not restrict it to a whitelist of names. Although it would be super rare, this would make it surprisingly ignore a few other places in the codebase that happen to call a function with the same signature.
What do you think about just whitelisting it and xit just like we do require? I'm pretty sure that would solve 99% of the problems. All of the other names like describe and others are used minimally and wouldn't break as often because those are at the top of the files, and don't have long descriptive names. I think just detecting it would be ok.
There was a problem hiding this comment.
I'm down. I'll add it and test. If you are using something else, too bad for you, it's going to indent you!
This happens very frequently that naming a test makes the entire line go > 80 columns and requires to indent everything which takes a lot more space. We've had this being reported multiple times and it also affects a lot of tests inside of fb. Fixes prettier#159 (Note, this is built on-top of prettier#841 but github doesn't handle stacked pull requests well...)
|
I whitelisted |
|
Awesome, thanks! |
This happens very frequently that naming a test makes the entire line go > 80 columns and requires to indent everything which takes a lot more space. We've had this being reported multiple times and it also affects a lot of tests inside of fb.
Fixes #159
(Note, this is built on-top of #841 but github doesn't handle stacked pull requests well... You want to look at the second commit here: a4bab0c )