Skip to content

Commit

Permalink
add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
julienw committed Jun 29, 2017
1 parent 578f02d commit 6553a34
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 108 deletions.
146 changes: 39 additions & 107 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,111 +1,43 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "babel-eslint",
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:flowtype/recommended",
"plugin:react/recommended",
"prettier",
"prettier/flowtype",
"prettier/react"
],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react",
"flowtype",
"import"
],
"rules": {
// Flow type rules:
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1,
"flowtype/generic-spacing": [2, "never"],
"flowtype/space-before-type-colon": [ 2, "never" ],
"flowtype/space-after-type-colon": [ 2, "always" ],
"flowtype/delimiter-dangle": [ 2, "always-multiline" ],

// ES6 Import rules:
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"import/named": "error",

// JS Rules:
"indent": [
"error",
2,
{ "SwitchCase": 1 }
],
"linebreak-style": [ "error", "unix" ],
"quotes": [ "error", "single", { "avoidEscape": true } ],
"semi": [ "error", "always" ],
"no-extra-semi": "error",
"comma-dangle": [ "error", "always-multiline" ],
"no-console": [ "error", { allow: ["log", "warn", "error"] } ],
"eqeqeq": "error",
"consistent-return": "error",
"curly": ["error", "all" ],
"dot-location": ["error", "property"],
"dot-notation": "error",
"no-alert": "error",
"no-caller": "error",
"no-constant-condition": ["error", { checkLoops: false }],
"no-else-return": "error",
"no-eval": "error",
"no-implied-eval": "error",
"no-extend-native": "error",
"no-native-reassign": "error",
"no-extra-bind": "error",
"no-labels": "error",
"no-implicit-globals": "error",
"no-invalid-this": "error",
"no-iterator": "error",
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-multi-spaces": "error",
"no-param-reassign": "error",
"no-proto": "error",
"no-return-assign": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-useless-concat": "error",
"no-useless-escape": "error",
"no-void": "error",
"no-with": "error",
"radix": "error",
"yoda": ["error", "never", { "exceptRange": true }],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": "error",
"comma-spacing": "error",
"comma-style": "error",
"jsx-quotes": ["error", "prefer-single"],
"key-spacing": "error",
"keyword-spacing": "error",
"no-new-object": "error",
"no-spaced-func": "error",
"semi-spacing": "error",
"space-in-parens": ["error", "never"],
"spaced-comment": "error",
"generator-star-spacing": "error",
"no-var": "error",
"prefer-const": "error",
"array-bracket-spacing": "error",
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always",
}],
"arrow-parens": ["error", "as-needed"],
},
"settings": {
"react": {
"pragma": "React",
"version": "15.0"
}
"sourceType": "module"
},
"plugins": [
"react",
"flowtype",
"import",
"prettier"
],
"rules": {
// ES6 Import rules:
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"import/named": "error",
"prettier/prettier": ["error", { singleQuote: true, trailingComma: "es5" }]
},
"settings": {
"react": {
"pragma": "React",
"version": "15.0"
}
}
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
"prop-types": "^15.5.10",
"query-string": "^4.2.3",
"react": "^15.6.1",
"react-transition-group": "^1.2.0",
"react-addons-perf": "^15.4.2",
"react-contextmenu": "^2.6.3",
"react-dom": "^15.6.1",
"react-redux": "^5.0.5",
"react-transition-group": "^1.2.0",
"redux": "^3.7.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
Expand Down Expand Up @@ -98,8 +98,10 @@
"devtools-license-check": "^0.2.0",
"eslint": "^3.10.2",
"eslint-config-google": "^0.6.0",
"eslint-config-prettier": "^2.2.0",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-prettier": "^2.1.2",
"eslint-plugin-react": "^6.4.0",
"express": "^4.15.3",
"fake-indexeddb": "^1.0.12",
Expand All @@ -114,6 +116,7 @@
"local-web-server": "^1.2.6",
"lodash.clonedeep": "^4.5.0",
"mkdirp": "^0.5.1",
"prettier": "^1.5.1",
"raw-loader": "^0.5.1",
"react-test-renderer": "^15.6.1",
"rimraf": "^2.5.4",
Expand Down

0 comments on commit 6553a34

Please sign in to comment.