Best Practices for Multi-Line Imports?
See original GitHub issueIt would be great if the style guide could weigh in on import lines that exceed the character limit (and thus need to be broken up on to multiple lines) …
import {longNameA, longNameB, longNameC, longNameD, longNameE} from '/some/pretty/long/path/
vs.
import {longNameA, longNameB, longNameC, longNameD, longNameE}
from '/some/pretty/long/path/
vs.
import {longNameA, longNameB, longNameC, longNameD,
longNameE} from '/some/pretty/long/path/
vs.
import {longNameA, longNameB, longNameC, longNameD,
longNameE
} from '/some/pretty/long/path/
vs.
import {
longNameA,
longNameB,
longNameC,
longNameD,
longNameE
} from '/some/pretty/long/path/
vs.
import {
longNameA,
longNameB,
longNameC,
longNameD,
longNameE
}
from '/some/pretty/long/path/
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
python - Is there a recommended format for multi-line imports?
As all those names are made available in your scope, I personally think that options 2 is the most clearest as you can...
Read more >PEP 328 – Imports: Multi-Line and Absolute/Relative
The import statement has two problems: Long import statements can be difficult to write, requiring various contortions to fit Pythonic style ...
Read more >JavaScript Best Practices — Comments, Imports, and ...
JavaScript Best Practices — Comments, Imports, and Indentation · No Cyclic Imports · No Default Export · No Duplicate Import · No Dynamic...
Read more >One Import Per Line Preference - PyCharm Guide - JetBrains
One Import Per Line Preference. Tell PyCharm to put each import on a separate line when it cleans up your imports.
Read more >AFW File Search - Import AFW Multi-Line Elements
This document introduces you to Importing Multi-Line Elements in AFW File Search. ... It is a best practice open up both the AFW...
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 FreeTop 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
Top GitHub Comments
The only example that would be acceptable is:
The curly braces thus follow the same indentation rules as every other curly brace block in the style guide, as do the trailing commas.
Adding a section on that to https://github.com/airbnb/javascript#modules would be great.
Great, thanks for the response.