-
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
eslint no-restricted-path false positive: bug caused by dir names that start with "index". #46544
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
Pinging @elastic/kibana-platform (Team:Platform) |
@elasticmachine merge upstream |
jenkins, test this |
Pinging @elastic/kibana-operations (Team:Operations) |
💚 Build Succeeded
|
d715867
to
f53b162
Compare
@spalger Added js and merged master. |
Jenkins test 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.
LGTM
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
💚 Build Succeeded |
…t start with "index". (elastic#46544) * index* to index.{ts,tsx} * Added test. * Added invalid test. * Added js.
Summary
Found this bug when writing code for #46537.
In current eslint setup, you cannot import from dirs whose name start with
index
likeindex_patterns
insrc/plugins
dir even if they are in the same folder.For example:
The cause of the problem is that
traverseToTopFolder()
returns the wrong folder when a folder name starts with 'index'.You can check it out by running the script below:
Result:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.This was checked for cross-browser compatibility, including a check against IE11Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportDocumentation was added for features that require explanation or tutorialsThis was checked for keyboard-only and screenreader accessibilityFor maintainers