-
Notifications
You must be signed in to change notification settings - Fork 46
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
front: get rid of repetitive imports #10783
base: dev
Are you sure you want to change the base?
Conversation
55a28b5
to
b9c3411
Compare
Signed-off-by: Theo Macron <[email protected]>
b9c3411
to
864e68c
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #10783 +/- ##
==========================================
- Coverage 81.83% 81.80% -0.03%
==========================================
Files 1081 1099 +18
Lines 106882 106916 +34
Branches 729 745 +16
==========================================
- Hits 87469 87467 -2
- Misses 19372 19392 +20
- Partials 41 57 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -19,7 +19,7 @@ import OPsSVGFile from 'assets/pictures/layersicons/ops.svg'; | |||
import switchesIcon from 'assets/pictures/layersicons/switches.svg'; | |||
import { osrdEditoastApi } from 'common/api/osrdEditoastApi'; | |||
import { Modal } from 'common/BootstrapSNCF/ModalSNCF'; | |||
import SwitchSNCF from 'common/BootstrapSNCF/SwitchSNCF/SwitchSNCF'; | |||
import { SwitchSNCF } from 'common/BootstrapSNCF/SwitchSNCF'; |
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.
You can default export in SwitchSNCF/index and then:
import { SwitchSNCF } from 'common/BootstrapSNCF/SwitchSNCF'; | |
import SwitchSNCF from 'common/BootstrapSNCF/SwitchSNCF'; |
@@ -0,0 +1,3 @@ | |||
import NGE from './NGE'; | |||
|
|||
export default NGE; |
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.
Maybe we can just rename NGE.tsx
to index.tsx
?
import StdcmHelpModule from './StdcmHelpModule'; | ||
|
||
export default StdcmHelpModule; |
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.
You can simply reeport default.
import StdcmHelpModule from './StdcmHelpModule'; | |
export default StdcmHelpModule; | |
export { default } from './StdcmHelpModule'; |
same for all your index.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.
Hum I'm not sure it will be a default export like this
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.
named reexports use as
:
export { default as StdcmHelpModule } from './StdcmHelpModule'
closes #8715