[Security Solution][Eslint] fix nested eslint workflow for webstorm#227301
Merged
kapral18 merged 1 commit intoelastic:mainfrom Jul 10, 2025
Merged
Conversation
767e749 to
16955cc
Compare
By default when using automatic eslint configuration in webstorm settings it finds 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 and assume that process.cwd() in eslint process would always be the kibana root. That's why they currently break in webstorm and alike IDEs. This PR fixes that. 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 so that eslint cascade works correctly. This is a known and current webstorm design limitation/bug per https://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0
16955cc to
6674352
Compare
Contributor
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
cc @kapral18 |
janmonschke
approved these changes
Jul 10, 2025
Contributor
janmonschke
left a comment
There was a problem hiding this comment.
kibana-cases changes lgtm
logeekal
approved these changes
Jul 10, 2025
Contributor
logeekal
left a comment
There was a problem hiding this comment.
LGTM 🚀 . Thanks for this improvement.
Contributor
|
Starting backport for target branches: 8.17, 8.18, 8.19, 9.0, 9.1 https://github.com/elastic/kibana/actions/runs/16192676112 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 10, 2025
…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)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 10, 2025
…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)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 10, 2025
…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)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 10, 2025
…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)
Contributor
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Jul 10, 2025
…torm (#227301) (#227409) # Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)](#227301) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T10:29:06Z","message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.2.0"],"title":"[Security Solution][Eslint] fix nested eslint workflow for webstorm","number":227301,"url":"https://github.com/elastic/kibana/pull/227301","mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227301","number":227301,"mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Jul 10, 2025
…storm (#227301) (#227408) # Backport This will backport the following commits from `main` to `8.19`: - [[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)](#227301) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T10:29:06Z","message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.2.0"],"title":"[Security Solution][Eslint] fix nested eslint workflow for webstorm","number":227301,"url":"https://github.com/elastic/kibana/pull/227301","mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227301","number":227301,"mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Jul 10, 2025
…torm (#227301) (#227410) # Backport This will backport the following commits from `main` to `9.1`: - [[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)](#227301) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T10:29:06Z","message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.2.0"],"title":"[Security Solution][Eslint] fix nested eslint workflow for webstorm","number":227301,"url":"https://github.com/elastic/kibana/pull/227301","mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227301","number":227301,"mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Jul 10, 2025
…storm (#227301) (#227407) # Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)](#227301) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T10:29:06Z","message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.2.0"],"title":"[Security Solution][Eslint] fix nested eslint workflow for webstorm","number":227301,"url":"https://github.com/elastic/kibana/pull/227301","mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227301","number":227301,"mergeCommit":{"message":"[Security Solution][Eslint] fix nested eslint workflow for webstorm (#227301)\n\nBy default automatic eslint configuration in webstorm settings\n\n\n\n\n\n[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.)\nclosest (to currently open file) eslint config and sets that directory\nas the current working directory for the entire eslint process\n\nSome existing nested eslint config files do not account for that when\nsearching for project root and assume that process.cwd() in eslint\nprocess would always be the kibana root.\n\nThat's why they currently break in webstorm with `Error: Cannot find\nmodule '/.eslintrc'`\n\nThis PR fixes that regression.\n\nBut even after this fix is merged, webstorm users still need to use\nmanual eslint config setting to detect the root of the project for\neslint process to circumvent that faulty automatic cwd detection of\nwebstorm and allow eslint cascade to work\nto support nested .eslintrc.js in combination with root .eslintrc.js\nfiles.\n\n\n\n\nUnfortunately this is a known and current webstorm design limitation/bug\nper\nhttps://youtrack.jetbrains.com/issue/WEB-45381#focus=Comments-27-4342029.0-0","sha":"488434c49d976d8902eac848813fc6558e904f82"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
kertal
pushed a commit
to kertal/kibana
that referenced
this pull request
Jul 25, 2025
…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
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.
By default automatic eslint configuration in webstorm settings
finds 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