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 more imports eslint rules #2589

Merged
merged 4 commits into from
Dec 28, 2017
Merged

Add more imports eslint rules #2589

merged 4 commits into from
Dec 28, 2017

Conversation

Hypnosphi
Copy link
Member

Issue: we don't get eslint errors for wrong named and default imports, which sometimes leads to bugs (e.g. #2576)

For those rules to work when importing our own packages, I had to add jsnext:main for all the packages that have a compiled file as their main

@Hypnosphi Hypnosphi added maintenance User-facing maintenance tasks patch:yes Bugfix & documentation PR that need to be picked to main branch labels Dec 28, 2017
@Hypnosphi Hypnosphi mentioned this pull request Dec 28, 2017
3 tasks
@codecov
Copy link

codecov bot commented Dec 28, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@c8fe23c). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2589   +/-   ##
=========================================
  Coverage          ?   32.68%           
=========================================
  Files             ?      397           
  Lines             ?     8835           
  Branches          ?      954           
=========================================
  Hits              ?     2888           
  Misses            ?     5268           
  Partials          ?      679
Impacted Files Coverage Δ
addons/info/src/components/markdown/index.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8fe23c...14ff606. Read the comment docs.

@@ -17,6 +17,7 @@ module.exports = {
},
settings: {
'import/core-modules': ['enzyme'],
'import/ignore': ['node_modules\\/(?!@storybook)'],
Copy link
Member

Choose a reason for hiding this comment

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

What is the usecase? I've tried to lint with this setting and without - nothing happened.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's because there's no errors =) Try replacing { logger } with logger here

From docs:

In practice, this means rules other than no-unresolved will not report on any imports with (absolute filesystem) paths matching this pattern.

@Hypnosphi Hypnosphi merged commit 4b92649 into master Dec 28, 2017
@Hypnosphi Hypnosphi deleted the eslint-imports branch December 28, 2017 11:26
@Hypnosphi Hypnosphi removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants