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

Allow source imports to be evaluated similar to named imports #1466

Merged
merged 2 commits into from
Aug 17, 2016

Conversation

markwongsk
Copy link
Contributor

This fixes #1431

optionExamples: ["true", '[true, {"named-imports-order": "lowercase-first"}]'],
optionExamples: [
"true",
'[true, {"named-imports-order": "lowercase-first", "source-imports-order": "lowercase-last"}]',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it actually useful to set a different option for the import names vs. the import sources? I guess if we wanted to consolidate those options into one, it might be a breaking change... but this feels a bit ugly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My rationale was:

  1. Breaking change if options are consolidated (renamed).
  2. The initial implementation is actually 'lowercase-last' for source-imports and 'case-insensitive' for named-imports, which seems to indicate a use-case envisioned, at least, by the author.

I don't mind changing if you guys think that we should only have one option though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think @danvk?

for now I think having these separately configurable is probably fine; we'll impose a sane default

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be fine with separate options. Module names tend to be more uniform (mostly lowercase, hyphenated) so I doubt this setting will matter much either way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danvk that's true for external dependencies, but much less true for relative path imports of local modules

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although it's good form to name all local files in that way as well to avoid filesystem case issues and the like,

@jkillian
Copy link
Contributor

Other than naming, looks good @markwongsk! Happy to merge it after that's tweaked

@jkillian
Copy link
Contributor

Sweet, thanks @markwongsk!

@jkillian jkillian merged commit f7567b5 into palantir:master Aug 17, 2016
soniro pushed a commit to soniro/tslint that referenced this pull request Aug 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to evaluate ordering of import sources case-insensitively
4 participants