Skip to content

Commit

Permalink
Add commit hook linting & formatting with husky, lint-staged and pret…
Browse files Browse the repository at this point in the history
…tier
  • Loading branch information
jamieweavis committed Nov 14, 2018
1 parent 3ca34f2 commit 6e682ba
Show file tree
Hide file tree
Showing 6 changed files with 1,233 additions and 134 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[**.{html}]
indent_style = tab
indent_size = 4
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"extends": ["airbnb-base", "prettier"],
"plugins": ["prettier"],
"extends": ["plugin:prettier/recommended"],
"root": true,
"env": {
"browser": true,
"node": true,
"es6": true
},
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"singleQuote": true
"singleQuote": true,
"trailingComma": "all"
}
26 changes: 22 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
"electron": "^2.0.5",
"electron-builder": "^20.25.0",
"eslint": "^5.2.0",
"eslint-config-airbnb-base": "^13.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.13.0",
"prettier": "^1.13.7"
"eslint-plugin-prettier": "^3.0.0",
"husky": "^1.1.4",
"lint-staged": "^8.0.4",
"prettier": "^1.15.2"
},
"homepage": "https://github.com/jamieweavis/streaker#readme",
"keywords": [
Expand All @@ -43,6 +44,23 @@
"dist-win": "build -w",
"pack": "build --dir",
"start": "electron src/app.js",
"test": "eslint ."
"lint": "eslint .",
"fmt": "prettier --write './src/**/*.{js,html}'"
},
"lint-staged": {
"*.js": [
"prettier --write",
"eslint",
"git add"
],
"*.html": [
"prettier --write",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
Loading

0 comments on commit 6e682ba

Please sign in to comment.