Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Phpstorm 如何从eslintrc文件获取editorconfig文件?_Phpstorm_Eslint_Editorconfig - Fatal编程技术网

Phpstorm 如何从eslintrc文件获取editorconfig文件?

Phpstorm 如何从eslintrc文件获取editorconfig文件?,phpstorm,eslint,editorconfig,Phpstorm,Eslint,Editorconfig,我试图为我的项目建立一个标准的代码风格,我发现,这是一个标准。我非常喜欢它,Intellij支持它(我们使用Intellij) 我有一个.eslintrc文件(从airbnb样式扩展) 那么,如何从.eslintrc文件中获取.editorconfig文件呢 如果要查找配置由eslint config airbnb规则强制执行的样式的.editorconfig,可以使用该模块的repo中的.editorconfig文件: 我找到了用于此目的的工具,但在从airbnb基本规则扩展规则时遇到了问题。

我试图为我的项目建立一个标准的代码风格,我发现,这是一个标准。我非常喜欢它,Intellij支持它(我们使用Intellij)

我有一个.eslintrc文件(从airbnb样式扩展)


那么,如何从.eslintrc文件中获取.editorconfig文件呢

如果要查找配置由
eslint config airbnb
规则强制执行的样式的
.editorconfig
,可以使用该模块的repo中的
.editorconfig
文件:

我找到了用于此目的的工具,但在从airbnb基本规则扩展规则时遇到了问题。也许你会有更好的运气:

$ ./node_modules/.bin/eslint-to-editorconfig  
/path/to/app/node_modules/eslint-to-editorconfig/node_modules/eslint/lib/config/config-file.js:402
            throw e;
            ^

Error: /path/to/app/node_modules/eslint-config-airbnb-base/rules/es6.js:
    Configuration for rule "arrow-parens" is invalid:
    Value "as-needed,[object Object]" has more items than allowed.

Referenced from: airbnb-base
Referenced from: /path/to/app/.eslintrc

不清楚您所说的“那么,如何从该.eslintrc文件中获取.editorconfig文件?”是什么意思。你能详细说明一下吗?如果在项目的根目录中同时包含这两个文件,Intellij将自动使用
.editorconfig
。如果您想将ESLint与Intellij一起使用,您需要使用类似的包,但它也应该选择并使用项目根目录中的配置。