【发布时间】:2019-10-01 13:03:57
【问题描述】:
我有一个 Laravel 5.8 项目,我的 .editorconfig 设置基于 PHP 编码(有 4 个空格)和其他一些考虑因素。我想知道是否有办法为我的resources/js 设置特定于文件夹的配置以适应不同的编码规则(如 2 个空格)。
另外,有没有办法在这个项目中设置 eslint 也可以毫无问题地 lint 我的 js 代码?
提前致谢!
【问题讨论】:
标签: laravel editorconfig
我有一个 Laravel 5.8 项目,我的 .editorconfig 设置基于 PHP 编码(有 4 个空格)和其他一些考虑因素。我想知道是否有办法为我的resources/js 设置特定于文件夹的配置以适应不同的编码规则(如 2 个空格)。
另外,有没有办法在这个项目中设置 eslint 也可以毫无问题地 lint 我的 js 代码?
提前致谢!
【问题讨论】:
标签: laravel editorconfig
据我所知,您可以在部分名称的方括号内指定路径:
# 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
在editorconfig.com的主页上阅读更多内容。
【讨论】: