Skip to content

Commit

Permalink
Add and configure prettier code formatter
Browse files Browse the repository at this point in the history
This commit adds prettier using the recommended configuration for
integrating with eslint:
https://prettier.io/docs/en/integrating-with-linters.html

I also added a .prettierrc.js file to configure our formatting based
on the existing .editorconfig.
https://prettier.io/docs/en/configuration.html
  • Loading branch information
Brandyn Friedly committed Jan 14, 2020
1 parent 51ab6ab commit 8752435
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 117 deletions.
3 changes: 2 additions & 1 deletion frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module.exports = {
extends: [
'eslint:recommended',
'airbnb-base',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended' // last so it overrides other configs
],
env: {
browser: true
Expand Down
7 changes: 7 additions & 0 deletions frontend/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// prettier config
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
singleQuote: true,
endOfLine: 'lf'
};
3 changes: 3 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,16 @@
"ember-window-mock": "^0.5.4",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-ember": "^6.2.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"faker": "^4.1.0",
"jsonwebtoken": "8.5.1",
"loader.js": "^4.7.0",
"mapbox-gl": "0.54.0",
"pretender": "3.0.1",
"prettier": "^1.19.1",
"rsvp": "^4.8.4",
"sass": "^1.16.1",
"semantic-ui-ember": "^3.0.0"
Expand Down
Loading

0 comments on commit 8752435

Please sign in to comment.