Linting & Auto Fixing for SCSS, Javascript and PHP (and maybe even Twig) #539
aaronmeder
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear friends of the interweb!
A topic I am struggling quite often with is to get consistent, good, Flynt/Bleech style compliant linting and fixing for all building blocks of a Flynt project: SCSS, Javascript and PHP.
We seem to follow a similar dev setup as you seem to use at Bleech, but also work with some other tech stacks which sometimes leads to compatibility issues in our linting setup, leaving it not working.
Goals
So I've tried, on a fresh vs code / user account, to find a setup that:
npm run lintFix
from the command lineCurrent State
After some tinkering this seems to be going in the right direction, but still has some issues:
Installed the following extensions in VS Code:
.vscode/settings.json
in my Flynt directory:This works:
Problems with PHP Linting/Fixing
Linting and fixing generally also works for PHP. I am however not really sure if its fully working or if the rules just are very relaxed, mainly around code indentation.
With the described setup it seems to be fully relaxed with this:
...which at least I am not 😬 I think it looks very unreadable and messy and would expect it to unify indentation after every bracket for example.
As far as I understand from
phpcs.xml.dist
it should follow PSR12 rules ("Code MUST use an indent of 4 spaces for each indent level, and MUST NOT use tabs for indenting.").Ideas?
Do you know if it should be stricter regarding indentation and there is a mistake in my setup or in general: what linting / fixing setup are you guys using?
Have a happy weekend anyone!
Aaron
Beta Was this translation helpful? Give feedback.
All reactions