简体   繁体   English

每个文件夹的WebStorm不同的ESLint配置

[英]WebStorm different ESLint config for each folder

I have JavaScript project which contain front-end and back-end folders. 我有一个包含前端和后端文件夹的JavaScript项目。 Each of those folders holds different ESLint config file. 这些文件夹中的每个文件夹都包含不同的ESLint配置文件。 Problem is that I cannot setup WebStorm to auto detect ESLint for current folder. 问题是我无法将WebStorm设置为自动检测当前文件夹的ESLint。 Is that possible or not? 有可能吗? As I can see, it can be set only one ESLint per project which makes WebStorm unusable for JavaScript full-stack development. 如我所见,每个项目只能设置一个ESLint,这使WebStorm无法用于JavaScript全栈开发。 Is there any workaround? 有什么解决方法吗?

In Languages and Frameworks > JavaScript > Code Quality Tools > ESLint > "ESLint package" points to eslintrc file in back-end folder. 在“语言和Frameworks > JavaScript > Code Quality Tools > ESLint > "ESLint package"指向后端文件夹中的eslintrc文件。 "Configuration file" is set to Automatic search option. “配置文件”设置为“自动搜索”选项。

When I open file from front-end folder it did not apply lint from it's eslintrc, but from back-end folder. 当我从前端文件夹打开文件时,它不是从eslintrc中应用lint,而是从后端文件夹中应用lint。 There is an error which shows that it search for plugin in back-end node_modules eslint folder instead of front-end one. 出现错误,表明它在后端node_modules eslint文件夹而不是前端文件夹中搜索插件。

This means that "WebStorm first looks for a .eslintrc or package.json in the folder with the file to be linted, then in its parent folder, and so on up to the project root" is not working ! 这意味着“ WebStorm首先在要插入文件的文件夹中,然后在其父文件夹中,依此类推,直到项目根目录,先查找.eslintrc或package.json” ,否则将无法正常工作

WebStorm 2019.1 EAP构建中增加了支持https://youtrack.jetbrains.com/issue/WEB-25561

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM