How with laravel/pint to add rule like no more 120 symbols in 1 line?

997 Views Asked by At

On my laravel 9 site I have installed laravel/pint and running command

./vendor/bin/pint  -v

checking modified code I see that there is no any rule like no more 120 symbols in 1 line.

Checking here https://github.com/laravel/pint/blob/main/resources/presets/laravel.php

I did not not find such rule... In my pint.json I set

"preset": "psr12",

How can I add such rule ?

"laravel/framework": "^9.19",
"laravel/pint": "^1.3",

Thanks in advance!

1

There are 1 best solutions below

0
Nicolas Buch On BEST ANSWER

Laravel pint is built on top of php-cs-fixer which does not, currently, support a rule to enforce a max number of characters.

There has however been created a feature request for this functionality, but since consensus is that it will be hard to implement - it might take a while before we see such a feature.

You can always follow the issue here: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/2790