Exceeds print-width (test framework describe/it/etc. Needs docs)
See original GitHub issuePrettier 1.14.2 Playground link
--parser babylon
Input:
describe('View', () => {
describe('mapDispatchToProps', () => {
it('Very long text that describes some stuff about stuff about stuff',
() => {
assert(
fakeDispatch.calledWithExactly(getSomethingNiceNowAgain.request({ wazzaaa })),
);
});
});
});
Output:
describe("View", () => {
describe("mapDispatchToProps", () => {
it("Very long text that describes some stuff about stuff about stuff", () => {
assert(
fakeDispatch.calledWithExactly(
getSomethingNiceNowAgain.request({ wazzaaa })
)
);
});
});
});
Expected behavior: The arrow function should be on the line under the string.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unit test functions exceeding printWidth – document? #6156
Expected behavior: expected it to break across new lines to respect the 80 width rule using vscode prettier and eslint extensions (vscode ...
Read more >Test Framework | 1.1.33 - Unity - Manual
The Unity Test Framework (UTF) enables Unity users to test their code in both Edit Mode and Play Mode, and also on target...
Read more >C# unit test tutorial - Visual Studio (Windows) - Microsoft Learn
This article steps you through creating, running, and customizing a series of unit tests using the Microsoft unit test framework for managed ...
Read more >Mocha - the fun, simple, flexible JavaScript test framework
simple, flexible, fun. Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun....
Read more >Firebase A/B Testing - Google
Firebase A/B Testing helps you optimize your app experience by making it easy to run, analyze, and scale product and marketing experiments.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The print width is a guideline for Prettier, not a hard limit. Mostly, Prettier stays below it, but there are a few exceptions added by popular demand, such as testing functions and some import statements. There are also some cases where there’s nothing Prettier can do, such as string literals or comments longer than 80 chars. Or if you nest your code 50 levels deep 😃
Please enlighten me if I’m off, but the 80 characters limit is there for a reason. Doesn’t it destroy the purpose of the whole thing if a line > 80 characters is allowed in some exceptional cases?
I’m mostly referring to fitting several files side by side, where a loose 80 character limit would still force you to side-scroll.