cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

Create linting scripts and integrate in CI

Open christianlupus opened this issue 4 years ago • 5 comments

PHP and Vue/JS needs static checking

PHP tasks

  • [x] Syntactical checks (php -l)
  • [x] Coding style (php-cs-fixer)
  • [x] #990

Vue tasks

  • [x] Coding style template part (prettier)
  • [x] Coding style script part (prettier)
  • [x] Coding style style part (prettier)
  • [x] Style guide CSS part (stylelint)
  • [x] Linting of JS code (eslint)

christianlupus avatar Jan 18 '21 10:01 christianlupus

any experience with mega-linter? It supports PHP and probably/maybe Vue

seyfeb avatar Jan 19 '21 19:01 seyfeb

I have no experience with it. I suggested psalm as some examples in the NC doc is given as php linter.

For vue I found something related to eslint in combination with webpack. Not completely done yet but it could be managed.

If we wanted to use multiple checks, that should be possible as well as I think we long as these are not working against each other.

christianlupus avatar Jan 19 '21 19:01 christianlupus

I found this suggestion. It uses prettier, styelint and eslint together. They combine it with automatic git hooks to lint upon commit. (These links serve as a reminder for myself as well :smile:)

christianlupus avatar Jan 24 '21 15:01 christianlupus

I can‘t read the article since it‘s behind a paywall, but why not try it, if he had good experiences with this 🤷‍♂️

seyfeb avatar Jan 24 '21 20:01 seyfeb

There are a few more tools mentioned here: https://thevaluable.dev/code-quality-check-tools-php/

christianlupus avatar May 14 '22 17:05 christianlupus