Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add eslint plugin for checking imports #3976

Merged
merged 1 commit into from
Jul 9, 2019
Merged

Conversation

snapwich
Copy link
Collaborator

@snapwich snapwich commented Jul 8, 2019

Type of change

  • Feature

Description of change

Added a custom eslint plugin to validate that imports are relative, that modules don't import other modules, and that only dependencies from a dependency whitelist can be included in src or modules files.

Related to #3964 and #3970

@snapwich
Copy link
Collaborator Author

snapwich commented Jul 9, 2019

taking a stab at solving this with the no-internal-modules plugin. if that doesn't work then we can merge this.

@snapwich
Copy link
Collaborator Author

snapwich commented Jul 9, 2019

Doesn't work :( no-internal-modules only detects importing child modules from a parent and the allow field is just for exceptions to that check. I think this custom plugin is probably the only solution for now. Ready for merge!

Copy link
Contributor

@idettman idettman left a comment

Choose a reason for hiding this comment

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

LGTM

@idettman idettman added needs 2nd review Core module updates require two approvals from the core team and removed needs review labels Jul 9, 2019
@jsnellbaker jsnellbaker self-requested a review July 9, 2019 17:32
Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

LGTM

@jsnellbaker jsnellbaker merged commit 95495bf into master Jul 9, 2019
@snapwich snapwich deleted the eslint-import-checks branch July 9, 2019 18:54
leonardlabat pushed a commit to criteo-forks/Prebid.js that referenced this pull request Jul 30, 2019
VideoReach pushed a commit to VideoReach/Prebid.js that referenced this pull request Aug 1, 2019
sa1omon pushed a commit to gamoshi/Prebid.js that referenced this pull request Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs 2nd review Core module updates require two approvals from the core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants