-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Use es6 exports, replace module.exports #12084
Conversation
af39b18
to
0b013c0
Compare
37f0990
to
88f9808
Compare
0612b12
to
69c84ce
Compare
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, CI passes and changes look good after a good skim. 🛳
I am getting an error building when not in dev mode
|
ae4bffd
to
8be360e
Compare
in these cases, named exports are the better replacement
don't export as default, rely on the named export
no reason not to, they pass when the no-var rule is disabled
d73580f
to
f131c59
Compare
@@ -1,5 +1,5 @@ | |||
import expect from 'expect.js'; | |||
import createProxy from '../create_proxy'; | |||
import { createProxy } from '../create_proxy'; |
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.
Should be importing createPath
here and update the references for the tests to pass.
f131c59
to
729a456
Compare
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 - tested build against x-pack
There's a lot of places in Kibana where
module.exports
is still used, despite our having moved to es6 modules a while ago. This causes problems when static analyzers try to resolve those exports.This PR is the result of using the exports transform from 5to6-codemod, and a little manual cleanup.
Since this change basically equates to using
export default
, there's a conflict with ourkibana-custom/no-default-export
eslint rule. I wanted to keep the scope of this PR down and avoid larger refactoring, so I added exceptions to the code. We can always clean them up in another PR.