Skip to content

Commit

Permalink
chore: add "prettier" to format code and pre-commit hook to enforce (m…
Browse files Browse the repository at this point in the history
…icrosoft#1049)

* add tslint-config-prettier to ts packages

* update prettier ignore and path changes

* add husky and lint-staged as dependencies

* add prettier to packages due to tslint conflicts

* update prettier npm script values

* initial run of prettier

* update prettier ignore and add lint-staged for precommit hook

* add prettier:diff build step

* move prettier ignore to local dir

* attempt to fix failing test in image

* fix tslint error

* remove forkts checker which bypassed the tslint rule overrides for prettier
  • Loading branch information
chrisdholt authored Oct 18, 2018
1 parent 0d8133d commit cc83644
Show file tree
Hide file tree
Showing 509 changed files with 10,835 additions and 6,602 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
name: Bootstrap dependencies
command: |
lerna bootstrap --no-ci
- run:
name: Ensure prettier formatting
command: |
lerna run prettier:diff
- run:
name: Run unit tests
command: |
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 90,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
}
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,28 @@
"scripts": {
"integration-tests:alpha": "node build/testing/sauce-labs/test-browsers.js alpha",
"integration-tests:beta": "node build/testing/sauce-labs/test-browsers.js beta",
"integration-tests:release": "node build/testing/sauce-labs/test-browsers.js release"
"integration-tests:release": "node build/testing/sauce-labs/test-browsers.js release",
"prettier:diff": "prettier --config .prettierrc '**/*.{ts,tsx,js}' --list-different"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx,js}": ["lerna run prettier", "git add ."]
},
"devDependencies": {
"@types/node": "^9.4.7",
"dotenv": "^6.0.0",
"eyes.selenium": "0.0.83",
"glob": "^7.1.2",
"husky": "^1.1.2",
"lerna": "^3.3.0",
"lint-staged": "^7.3.0",
"markdown-it": "^8.4.1",
"rimraf": "^2.6.2",
"prettier": "1.14.3",
"ts-node": "^5.0.1",
"typescript": "^3.0.1",
"yargs": "^11.0.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/fast-animation/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage/*
dist/*
www/*
Loading

0 comments on commit cc83644

Please sign in to comment.