Skip to content

Commit

Permalink
Added prettier with staged commit hook - apache#1205
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Tobias committed Jul 14, 2019
1 parent 8773b05 commit d7491a3
Show file tree
Hide file tree
Showing 6 changed files with 1,174 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_new_line = true
end_of_line = lf
18 changes: 6 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@
"root": true,
"parser": "babel-eslint",

"plugins": [
"react"
],
"plugins": ["react"],

"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier", "prettier/react"],

"rules": {
"semi": ["error", "always"],
"keyword-spacing": "error",
"space-infix-ops": "error",
"space-before-blocks": "error",
"array-bracket-spacing": ["error", "never"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"comma-spacing": ["error", {"before": false, "after": true}],
"computed-property-spacing": ["error", "never"],
"eol-last": "error",
"indent": ["error", 2, { "SwitchCase": 1, "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }],
"indent": ["error", 2, {"SwitchCase": 1, "VariableDeclarator": {"var": 2, "let": 2, "const": 3}}],
"no-case-declarations": "off",
"no-console": [1, { "allow": ["warn", "error", "info"] }],
"no-console": [1, {"allow": ["warn", "error", "info"]}],
"no-else-return": "error",
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-trailing-spaces": "error",
Expand All @@ -33,7 +28,7 @@
"no-unused-vars": ["error", {"varsIgnorePattern": "ReactDOM"}],
"react/display-name": "off",
// disabling for now since there are too many components without PropTypes
"react/prop-types": "off"
"react/prop-types": "off"
},

"parserOptions": {
Expand Down Expand Up @@ -84,5 +79,4 @@
"prettyPrint": true,
"jest": true
}

}
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist/
test/
assets/

app/**/*.react.js
app/addons/.module-cache
app/addons/**/assets/*
app/addons/**/dependencies/*
app/load_addons.js
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"semi": true,
"singleQuote": true,
"bracketSpacing": false,
"printWidth": 120
}
Loading

0 comments on commit d7491a3

Please sign in to comment.