-
Notifications
You must be signed in to change notification settings - Fork 121
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
fix: type issue pulling from src/index #645
Conversation
issue related to jsx-eslint/eslint-plugin-react#2560
- add import/no-restricted-paths rule - prevent import anywhere in src/ from src/index.ts - prevent import anywhere in src outside of src
Codecov Report
@@ Coverage Diff @@
## master #645 +/- ##
==========================================
+ Coverage 72.02% 72.52% +0.49%
==========================================
Files 246 259 +13
Lines 8165 8411 +246
Branches 1593 1633 +40
==========================================
+ Hits 5881 6100 +219
- Misses 2253 2276 +23
- Partials 31 35 +4
Continue to review full report at Codecov.
|
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.
LGTM - doesn't affect stories being rendered (tested locally on Chrome). Es lint rule set up correctly and errors as expected when adding import '../../../scripts/custom_matchers';
in the file elastic-charts/src/utils/themes/colors.ts
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.
LGTM. I've had the same issue today within my test caused by importing something directly from the src/index.ts
## [18.4.1](v18.4.0...v18.4.1) (2020-04-22) ### Bug Fixes * type issue pulling from src/index ([#645](#645)) ([3f3a996](3f3a996))
🎉 This PR is included in version 18.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [18.4.1](elastic/elastic-charts@v18.4.0...v18.4.1) (2020-04-22) ### Bug Fixes * type issue pulling from src/index ([opensearch-project#645](elastic/elastic-charts#645)) ([9c72967](elastic/elastic-charts@9c72967))
Summary
The typecheck for the built library includes surrounding files and directories, which when running the check
../../src
may resolve to a module but this file is outside of thedist
directory and will fail when checked in kibana.To prevent this in the future I added a linting rule to prevent imports from
src/index.ts
and any parent directory/files of src.Also, fix tsconfig check to error on references outside of the dist folder.