question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Long-length import statements could wrap

See original GitHub issue

In the example:

import someCoolUtilWithARatherLongName from '../../../../utils/someCoolUtilWithARatherLongName';

Which is 94 characters. Given that I want to wrap at 80 characters, my subjective ideal would be

import someCoolUtilWithARatherLongName
  from '../../../../utils/someCoolUtilWithARatherLongName';

This isn’t an issue with the import { name } from 'source' syntax.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
jlongstercommented, Feb 2, 2017

I would say we just let it go past the max length threshold. It’s not common for the above to happen, so I don’t think we should worry about it too much.

2reactions
merlosycommented, May 25, 2018

@PavelPikat I found a better option than ignoring tslint. You can add exception for specific regex. Prettier will have the lead for managing imports and exports, since it has a special way to deal with them.

// edit tslint.json
"max-line-length": [
     true, 
    { 
        "limit": 140, 
        "ignore-pattern": "^import |^export {(.*?)}" 
    }
],
Read more comments on GitHub >

github_iconTop Results From Across the Web

coding style - Long imports in Python - Stack Overflow
The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can ...
Read more >
Java Code Style. Add option to not line wrap on import ...
An option to force line wrapping in import statements will be added only if there will be enough users who really need it....
Read more >
PreparedStatement (Java Platform SE 7 ) - Oracle Help Center
A SQL statement is precompiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple...
Read more >
Breaking up long lines of code in Python
Let's talk about breaking up long lines of code in Python. How to continue code on the next line. The import statement below...
Read more >
vintage sequin kimono
Long styles look great when layered with dresses, while cropped wraps can double up as a top when worn with jeans.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found