-
Notifications
You must be signed in to change notification settings - Fork 887
Add grouped imports by default in tslint:all #4420
Conversation
BTW, since ordered imports is used in tslint:recommended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall this change seems fine, but see my comment below.
no, we shouldn't change tslint:recommended
, since that configuration follows semver (see configuration docs)
import { camelize } from "../src/utils"; | ||
import { IOptions } from "./../src/language/rule/rule"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this newline added by the grouped-imports option? what's the logic here? it seems to separate the different levels of imports into groups in some places, but not in others (e.g. in exclusionFactory.ts
, ../../
imports are in the same group as ../
imports). I haven't been following this rule closely, but that behavior is a little surprising to me and I'd like to revisit it before enabling this rule in tslint:all
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. There is 3 différents levels: libraries, parents folder and same folder.
import something from "module"
import foo from "../../foo"
import bar from "../bar"
import baz from "./baz"
ok, the documentation for |
@adidahiya
|
Hi @adidahiya, could you be more explicit about the lack of documentation ? Thanks |
with #4134 merged, the docs are now in a better place. I'll merge this and resolve any conflicts on master |
* master: (60 commits) Added tslint-brunch to the list of 3rd party tools (palantir#4251) Switch to tslint-plugin-prettier, clean up rule options config syntax (palantir#4488) Enable grouped-imports for ordered-imports rule in tslint:all config (palantir#4420) Ordered imports grouping (palantir#4134) trailing-comma: check for a closing parenthesis (palantir#4457) Update index.md (palantir#4473) [bugfix] `no-unsafe-any`: allow implicitly downcasting `any` to `unknown` (palantir#4442) Add v5.12.1 changelog Bump version to 5.12.1 Fix quotemark avoid-template issues (palantir#4408) Skip linting JSON files entirely (palantir#4001) Fix strict-type-predicate for unknown (palantir#4444) restrict increment-decrement fixer while fixing the postfix unary expressions (palantir#4415) Mention file names in script parse failures (palantir#4397) Revert breaking change to tslint:recommended, update tslint:latest (palantir#4404) Fix quotemark avoid-template issues (palantir#4408) Bump tslint dev dependency to 5.12.0 (palantir#4452) Skip linting JSON files entirely (palantir#4001) Fix strict-type-predicate for unknown (palantir#4444) [README] Update link for Webstorm (palantir#4450) ...
Overview of change:
The tslint:all config seems to be used in order to activate all the rules and to be the strictest possible.
"grouped-imports":true
is stricter than"grouped-imports":false
CHANGELOG.md entry:
[enhancement] add grouped import in the all config