-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] enable prettier to run automatically #522
Conversation
Upgrade to latest of each supported with node v14 Ignore coverage and dist directories when running prettier
✅ Deploy Preview for creativecommons-chooser ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
package.json
Outdated
@@ -28,8 +28,9 @@ | |||
"test:unit": "vue-cli-service test:unit", | |||
"build-component": "rm -rf dist && VUE_APP_CC_OUTPUT=embedded vue-cli-service build --target wc --name license-chooser src/main.js", | |||
"test:cypress": "node_modules/.bin/cypress open", | |||
"lint": "vue-cli-service lint src/**/*.{vue,js} --fix && npx stylelint ./src/**/*.{vue,css} --fix", | |||
"i18n:report": "vue-cli-service i18n:report -v --src src/**/*.vue --locales src/locales/**.json -o output.json" | |||
"lint": "prettier ./src/**/*.{css,js,vue} --write && vue-cli-service lint src/**/*.{vue,js} --fix && npx stylelint ./src/**/*.{vue,css} --fix", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier docs specifically state that prettier should run after linters but I get a build error if it does:
⠴ Building for production...
ERROR Failed to compile with 2 errors 8:42:14 PM
error in ./src/components/Stepper.vue
Module Error (from ./node_modules/eslint-loader/index.js):
/app/src/components/Stepper.vue
77:20 warning Unexpected space before function parentheses space-before-function-paren
100:1 error Expected indentation of 6 spaces but found 8 indent
101:1 error Expected indentation of 8 spaces but found 10 indent
102:1 error Expected indentation of 6 spaces but found 8 indent
...
I suspect the eslint-config-prettier
config is not working as expected and/or something else needs upgrading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK no, I think the conflict was specifically with eslint/prettier indentation rules. This goes away with 218b42a .
Now the remaining problem is stylelint falling over during the git hook...
- update actions to latest versions - use Node 14 instead of 12 - use 2 spaces instead of 4
- builds successfully - tests without errors: Test Suites: 15 passed, 15 total Tests: 170 passed, 170 total Snapshots: 0 total Time: 7.911s
Shouldn't be used in conjunction with prettier
Closing in favour of #530. |
Fixes
Description
Runs prettier automatically for consistency.
Technical details
coverage
anddist
directories when running PrettierTests
TODO
Checklist
Update index.md
).main
ormaster
).visible errors.
Developer Certificate of Origin
For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."
Developer Certificate of Origin