-
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
Add no default exports custom rule #10981
Add no default exports custom rule #10981
Conversation
Thoughts on making this part of the base config https://github.com/elastic/eslint-config-kibana? And maybe we could explicitly override it to off until some automation can pick up the rest. |
Ah, perfect @jbudz, wasn't aware of that. Yes, seems appropriate to add there. |
@jbudz I take it back, I seem to be having trouble making the rule part of that package, and then including it in kibana. Maybe I am doing something wrong. Here is some of my configuration: My suspicion is it's because my rule is a local, nested npm module, referred to via a relative file, not a true, hosted npm module. Unless you have any suggestions, I'm going to keep it local to kibana for now, since I was able to get that working. |
465c0fc
to
0546a7d
Compare
Jenkins error:
hmmm... |
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 move the custom-eslint-rules
to a packages/
directory? I think that's a nice default from https://lernajs.io/ to also use here (aka whenever we build packages that Kibana itself relies on, put them in packages/
unless we create separate repos for them.)
We should perhaps also npm publish
it when we merge, so that xpack can rely on the same rule.
(Longer term we should maybe pull the Kibana eslint config into this repo too)
@kjbekkelund Took your suggestion for the As for
I think the preferred place for this new rule to go was in the shared config, but I was having issues getting it to run correctly in there. For the sake of time, decided to keep it in here. So sounds like the separate eslint repo is preferred? I don't have an opinion on the matter. cc @spalger who initially suggested I move this rule into that package. |
8ad743f
to
5e3619a
Compare
Build error due to S3/amazon issue
jenkins, test this. |
5e3619a
to
84b108a
Compare
@kjbekkelund Any last feedback or is this good to submit (once 5.4 branch is created so I don't cause any 5.4 last minute delays)? |
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"license": "ISC" |
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.
Looks like this file might be mostly copied, e.g. requireindex
, mocha
. I think this should be a minimal npm package.json, if possible, and only specify name
, version
, and whatever deps are actually needed (if any).
(Could maybe keep the description
and make it Custom ESLint rules for Kibana
)
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.
Ah, great catch. Indeed much of it was copied. :) 👍
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.
Other than the package.json it LGTM
Turn it on only at the level of /kibana/src/core_plugins/public/ for now, just to keep the PR sizes manageable.
84b108a
to
1c966df
Compare
* Introduce a custom kibana estlint rule for no default exports Turn it on only at the level of /kibana/src/core_plugins/public/ for now, just to keep the PR sizes manageable. * Don't call functions directly on the import * Create a packages dir and move the custom rule in there * Remove copied package.json portions, use minimal info necessary
* Introduce a custom kibana estlint rule for no default exports Turn it on only at the level of /kibana/src/core_plugins/public/ for now, just to keep the PR sizes manageable. * Don't call functions directly on the import * Create a packages dir and move the custom rule in there * Remove copied package.json portions, use minimal info necessary
Abide by the decision made here #8641 and introduce a new eslint rule.
For now I am only introducing it at
kibana/src/core_plugins/kibana/public
. It's going to be a large chunk of work to convert everything over but at least this covers a portion of the code base, while I work on incrementally adding it to other parts.