Throw Prettier ES Lint errors in CI
Closed this issue · 2 comments
tobeycodes commented
I setup a GitHub action today. When I run yarn code:lint
in CI I want to be able to throw any prettier errors. Is this possible somehow?
arianacosta commented
Hi @schrapel,
You may use yarn code:check
to check the ESLint as well as the Prettier rules instead of actually formatting.
If you only want the prettier rules, you may run yarn code:format --check
I hope that was useful. I'll update the docs with this feature.
tobeycodes commented
@arianacosta Thanks. Looks like I was using a older version that didn't add the code:check command. For anyone that finds this issue this is how I extended Poetic to use Stylelint (I have a slightly different folder structure so don't use src)
"code:check": "yarn code:lint; yarn code:stylelint; yarn code:format --check",
"code:clean": "yarn code:lint --fix; yarn code:stylelint --fix; yarn code:format --write",
"code:lint": "eslint --ext .js,.jsx,.ts,.tsx ./",
"code:stylelint": "stylelint './**/*.{js,jsx,ts,tsx}'",
"code:format": "prettier './**/**.{js,jsx,ts,tsx}'",
"code:check:rules": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",