Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Exclude length from imports via max-line-length #1872

Closed
Ne-Ne opened this issue Dec 14, 2016 · 3 comments
Closed

Exclude length from imports via max-line-length #1872

Ne-Ne opened this issue Dec 14, 2016 · 3 comments

Comments

@Ne-Ne
Copy link

Ne-Ne commented Dec 14, 2016

Hi,

Question / Possible feature..?


gulp-tslint: 6.1.1 via - Visual Studio

Rule:

https://palantir.github.io/tslint/rules/max-line-length/

tslint.json configuration:

"max-line-length": [
  true,
  150
],

Is there any existing way we can exclude imports from this rule?

import { item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19, item20 } from "@angular/router";

Many thanks.

@IllusionMH
Copy link
Contributor

@Ne-Ne this is exact case for this rule.
In this case it is more preferable to write imports one in line (much easy merge/review changes in list) or you may load it as

import * as routes from "@angular/router";

and then use required items as routes.item2 when needed.

Or you can just use rule flags to disable this rule for single line.

@adidahiya
Copy link
Contributor

This has been requested before in #1123. I wouldn't mind having an option to disable the rule for import statements, but we won't enable in the built-in configurations.

@ajafff
Copy link
Contributor

ajafff commented Oct 31, 2017

Closing in favor of #1123

@ajafff ajafff closed this as completed Oct 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants