【问题标题】:.editorconfig folder-specific configuration.editorconfig 文件夹特定的配置
【发布时间】:2019-10-01 13:03:57
【问题描述】:

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

另外,有没有办法在这个项目中设置 eslint 也可以毫无问题地 lint 我的 js 代码?

提前致谢!

【问题讨论】:

    标签: laravel editorconfig


    【解决方案1】:

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

    # 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的主页上阅读更多内容。

    【讨论】:

    • 像魅力一样工作!非常感谢丹
    猜你喜欢
    • 1970-01-01
    • 2018-09-29
    • 1970-01-01
    • 2021-04-22
    • 2011-01-16
    • 2018-05-21
    • 2022-10-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多