Skip to content

Commit

Permalink
Use prettier for autoformatting
Browse files Browse the repository at this point in the history
Not having to think about formatting is life-changing. Prettier will
autoformat JavaScript, TypeScript, etc.

See: https://github.com/prettier/prettier
  • Loading branch information
Graham42 committed Jun 30, 2017
1 parent 9d33745 commit 4e8cc2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 40 deletions.
46 changes: 7 additions & 39 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
},
"parser": "babel-eslint",
"rules": {
"prettier/prettier": [
"error",
{
"printWidth": 120
}
],
// Possible Errors
"comma-dangle": [2, "never"],
"no-cond-assign": 2,
"no-console": 0,
"no-constant-condition": 2,
Expand All @@ -24,12 +29,9 @@
"no-empty-character-class": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 0,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-negated-in-lhs": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
Expand All @@ -45,7 +47,6 @@
"consistent-return": 2,
"curly": 2,
"default-case": 2,
"dot-notation": 2,
"eqeqeq": 2,
"guard-for-in": 2,
"no-alert": 2,
Expand All @@ -63,7 +64,6 @@
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": 2,
"no-multi-str": 0,
"no-native-reassign": 2,
"no-new": 2,
Expand Down Expand Up @@ -100,63 +100,31 @@
"no-unused-vars": 2,
"no-use-before-define": 2,
// Stylistic Issues
"indent": [2, 2, {
"SwitchCase": 1
}],
"brace-style": 2,
"camelcase": 0,
"comma-spacing": 2,
"comma-style": 2,
"consistent-this": 0,
"eol-last": 2,
"func-names": 0,
"func-style": 0,
"key-spacing": [2, {
"beforeColon": false,
"afterColon": true
}],
"max-nested-callbacks": 0,
"new-cap": 0,
"new-parens": 2,
"no-array-constructor": 2,
"no-inline-comments": 0,
"no-lonely-if": 2,
"no-mixed-spaces-and-tabs": 2,
"no-nested-ternary": 2,
"no-new-object": 2,
"semi-spacing": [2, {
"before": false,
"after": true
}],
"no-spaced-func": 2,
"no-ternary": 0,
"no-trailing-spaces": 2,
"no-multiple-empty-lines": 2,
"no-underscore-dangle": 0,
"one-var": 0,
"operator-assignment": [2, "always"],
"padded-blocks": 0,
"quotes": [2, "double"],
"quote-props": [2, "as-needed"],
"semi": [2, "always"],
"sort-vars": [2, {"ignoreCase": true}],
"keyword-spacing": 2,
"space-before-blocks": 2,
"object-curly-spacing": [2, "never"],
"array-bracket-spacing": [2, "never"],
"space-in-parens": 2,
"space-infix-ops": 2,
"space-unary-ops": 2,
"spaced-comment": 2,
"wrap-regex": 0,
// Legacy
"max-depth": 0,
"max-len": [2, 120],
"max-params": 0,
"max-statements": 0,
"no-plusplus": 0
},
"plugins": [
"prettier",
"react"
],
"extends": ["plugin:react/recommended"]
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"css-loader": "^0.23.1",
"eslint": "^2.2.0",
"eslint": "^3.14.1",
"eslint-plugin-prettier": "^2.1.2",
"eslint-plugin-react": "^4.1.0",
"font-awesome-webpack": "0.0.4",
"jasmine-core": "^2.4.1",
Expand All @@ -54,6 +55,7 @@
"less": "^2.6.0",
"less-loader": "^2.2.2",
"phantomjs-prebuilt": "^2.1.6",
"prettier": "^1.5.0",
"react-transform-hmr": "^1.0.1",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
Expand Down

0 comments on commit 4e8cc2b

Please sign in to comment.