segmentio / analytics.js-integration-tester

Helper to quickly test an analytics.js integration.
MIT License
8 stars 11 forks source link

Add prettier #40

Open fathyb opened 6 years ago

fathyb commented 6 years ago

Rebased on #39, please merge it before this one. Same as segmentio/analytics.js-core#89


This PR adds prettier-eslint, which is just prettier with its output piped to eslint --fix. js files are formatted using eslint rules, while md and json files only using prettier.

husky is added to setup a Git precommit hook, and lint-staged to only check staged files. This will make sure every commit is properly formatted and passes the lint test. This can be bypassed by using the Git commit --no-verify option.

A format script is added to run prettier on all files.

Demo


https://segment.atlassian.net/browse/LIB-413 cc @f2prateek