[9.0] [Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)#227409
Merged
kibanamachine merged 1 commit intoelastic:9.0from Jul 10, 2025
Merged
Conversation
…lastic#227301) By default automatic eslint configuration in webstorm settings  [finds](https://www.jetbrains.com/help/webstorm/eslint.html#ws_js_eslint_manual_configuration:~:text=detects%20the%20working%20directory%20automatically.%20First%2C%20it%20looks%20for%20a%20directory%20closest%20to%20the%20linted%20file%20which%20contains%20a%20configuration%20file.) closest (to currently open file) eslint config and sets that directory as the current working directory for the entire eslint process Some existing nested eslint config files do not account for that when searching for project root and assume that process.cwd() in eslint process would always be the kibana root. That's why they currently break in webstorm with `Error: Cannot find module '/.eslintrc'` This PR fixes that regression. But even after this fix is merged, webstorm users still need to use manual eslint config setting to detect the root of the project for eslint process to circumvent that faulty automatic cwd detection of webstorm and allow eslint cascade to work to support nested .eslintrc.js in combination with root .eslintrc.js files.  Unfortunately this is a known and current webstorm design limitation/bug per https://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0 (cherry picked from commit 488434c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.0:Questions ?
Please refer to the Backport tool documentation