Tslint: Exclude length from imports via max-line-length

Created on 14 Dec 2016  ·  3Comments  ·  Source: palantir/tslint

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.

Accepting PRs Enhancement

Most helpful comment

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.

All 3 comments

@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.

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.

Closing in favor of #1123

Was this page helpful?
0 / 5 - 0 ratings

Related issues

allbto picture allbto  ·  3Comments

rajinder-yadav picture rajinder-yadav  ·  3Comments

dashmug picture dashmug  ·  3Comments

mrand01 picture mrand01  ·  3Comments

cateyes99 picture cateyes99  ·  3Comments