Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.editorconfig folder-specific configuration

I have a Laravel 5.8 project and my .editorconfig setup is based on PHP coding (with 4 spaces) and some other considerations. What I want to know if there is a way to set up a folder-specific configuration for my resources/js in order to adapt different coding rules (like 2 spaces).

Also, is there a way to setup eslint in this project to also lint my js code without any trouble?

Thanks in advance!

like image 294
enbermudas Avatar asked Jul 21 '26 14:07

enbermudas


1 Answers

As far as I know, you can specify a path within the section name's square brackets:

# 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

Read more on the main page of editorconfig.org.

like image 56
Dan Avatar answered Jul 23 '26 10:07

Dan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!