Skip to content
This repository was archived by the owner on Feb 2, 2018. It is now read-only.

Conversation

@bajtos
Copy link
Contributor

@bajtos bajtos commented Oct 6, 2017

Add a build step to npm run test to verify that all code has been formatted by prettier.

Developers can run npm run lint:fix to get the formatting fixed for them.

This is a follow-up for loopbackio/loopback-next#601.

@bajtos bajtos added this to the Sprint 46 milestone Oct 6, 2017
@bajtos bajtos self-assigned this Oct 6, 2017
@bajtos bajtos requested a review from virkt25 October 6, 2017 13:36
Copy link
Collaborator

@virkt25 virkt25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good but build is failing (I think it has something to do with package.json and tslint.json

@bajtos bajtos force-pushed the build/prettier branch 2 times, most recently from a15b46b to b22b902 Compare October 9, 2017 09:22
@bajtos
Copy link
Contributor Author

bajtos commented Oct 9, 2017

Apparently prettier has a different idea about formatting of JSON files than npm (via JSON.stringify has). I added package.json to .prettierignore, but it makes me wonder - should I rather disable prettier for all JSON file?

@bajtos
Copy link
Contributor Author

bajtos commented Oct 9, 2017

cis-jenkins build is reporting formatting errors in tested-dep-tree.json, see https://cis-jenkins.swg-devops.com/job/nb/job/loopback-next-extension-starter~master/label=x64%20&&%20linux%20&&%20nvm,nodeVersion=6/57/console. I am going to disable linting of all JSON files.

Add a build step to `npm run test` to verify that all code has been
formatted by prettier.

Developers can run `npm run lint:fix` to get the formatting fixed for
them.
@bajtos
Copy link
Contributor Author

bajtos commented Oct 9, 2017

@virkt25 PTAL again.

dist
dist6
api-docs
*.json
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is for IDE extensions - it's telling them to don't apply prettier formatting when saving JSON files. It works for me in VS Code.

@bajtos bajtos merged commit 6e59627 into master Oct 10, 2017
@bajtos bajtos deleted the build/prettier branch October 10, 2017 13:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants