.editorconfig 文件夹特定的配置

Enr*_*dez 2 laravel editorconfig

我有一个 Laravel 5.8 项目,我的.editorconfig设置基于 PHP 编码(有 4 个空格)和其他一些注意事项。我想知道是否有办法为我设置文件夹特定的配置resources/js以适应不同的编码规则(如 2 个空格)。

另外,有没有办法在这个项目中设置 eslint 来 lint 我的 js 代码没有任何问题?

提前致谢!

Dan*_*Dan 5

据我所知,您可以在部分名称的方括号内指定路径:

# Rules specified in this section matching all files
[*]
end_of_line = lf
insert_final_newline = true

[*.php]
indent_style = space
indent_size = 4

# Rules in here only match .js files inside your resources/js folder.
[resources/js/**.js]
indent_style = space
indent_size = 2
Run Code Online (Sandbox Code Playgroud)

editorconfig.com 的主页上阅读更多信息