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

[new-rule] no-default-import #4023

Merged
merged 2 commits into from
Dec 12, 2018

Conversation

pablobirukov
Copy link
Contributor

@pablobirukov pablobirukov commented Jul 10, 2018

Overview of change:

As the no-default-export, the rule supposed to reduce usage of default imports/exports.

New rule supposed to narrow the scope of your changes in the case of medium-sized (and bigger) projects. Say, you have 20 packages and every removed default export from utility package would lead to changes in each package, which might be harder to get merged by various reasons (harder to get your code approved due to a number of required reviewers; longer build time due to a number of affected packages). That's why "requires too many changes elsewhere" is a reason why I see no-default-export ignored so often.

Unlike no-default-export, the rule requires you to make changes only in the package you work on and the package you import from (unless the member you try to import already exported as a named one).

It has a config option where you have to specify a regexp for packages you own, imports from which are to be checked. By default it checks relative imports, presuming, you own these files.

CHANGELOG.md entry:

[new-rule] no-default-import

@johnwiseheart
Copy link
Contributor

@R00GER, can you please fix the tests by adding your rule to tslint:all?

@pablobirukov
Copy link
Contributor Author

@johnhferland, ✅

Copy link
Contributor

@johnwiseheart johnwiseheart left a comment

Choose a reason for hiding this comment

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

Hi @R00GER, can you please rephrase the rationale here to explain the use of the rule a little better - I think we can probably improve the wording of the example.

Once thats done, please ping me and I'll merge.

@pablobirukov
Copy link
Contributor Author

@johnwiseheart, please take a look at another attempt

@pablobirukov
Copy link
Contributor Author

Hi @johnwiseheart,

any chance to have this merged?

@ericanderson ericanderson merged commit cf35ec8 into palantir:master Dec 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants