Dev/php lint experiment
- As defined here we have new configuration for all cloud apps
- Template to compare against
Instructions
-
Update configuration files using reference MR -
Double-check package.json
andcomposer.json
files(Lots ofdevDependencies
can be removed`) -
Remove extra config files(Only ones needed are: .editorconfig, .eslintrc.js, .gitignore, .gitlab-ci.yml, package.json, .php-cs-fixer.dist.php, stylelint.config.js, .stylelintignore, babel.config.js, webpack.config.js
)
-
-
Use node 16 locally -
Install nvm -
nvm install lts/gallium
-
nvm alias default lts/gallium
-
nvm use lts/gallium
-
-
Confirm with npm i
andcomposer install
that packages install correctly -
Confirm that lint and stylelint jobs run -
npm run lint
-
npm run stylelint
-
vendor/bin/php-cs-fixer fix --dry-run --config=.php-cs-fixer.dist.php .
-
-
Lint all files so lint jobs pass: -
vendor/bin/php-cs-fixer --config=.php-cs-fixer.dist.php fix .
-
npm run lint:fix
-
npm run stylelint:fix
-
-
Setup git pre-commit hook from here -
Paste the contents from the link to .git/hooks/pre-commit
-
chmod +x .git/hooks/pre-commit
-
-
Ensure that all lint and build jobs pass -
Deploy app to dev server and test that it works as expected
Edited by Akhil