ff-stream-web

git clone git://archive.git.mtrnord.blog/MTRNord/ff-stream-web.git
Log | Files | Refs | README | LICENSE

commit ebd5faa1f04b5e1f98bdda844d35658c1190160e
parent 97fbda638a719bda3842ca313c909112af1b6b9f
Author: Pavel Lang <langpavel@phpskelet.org>
Date:   Mon,  2 Jan 2017 16:35:53 +0100

Merge pull request #1031 from frenzzy/pre-commit

Add pre-commit hook that automatically formats staged files
Diffstat:
M.editorconfig | 4++--
MCONTRIBUTING.md | 4++--
MLICENSE.txt | 2+-
Mpackage.json | 21+++++++++++++++++++++
4 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/.editorconfig b/.editorconfig @@ -16,5 +16,5 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.md] -trim_trailing_whitespace = false +# editorconfig-tools is unable to ignore longs strings or urls +max_line_length = null diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md @@ -3,7 +3,7 @@ React Starter Kit is currently the most widely adopted Node.js/React boilerplate used by many tech startups around the globe. We're working hard to keep it up to date, making sure that it follows best practices and high coding standards, paying extremely close attention to details. - + Your contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given. @@ -21,7 +21,7 @@ Feedback is the breakfast for champions! We'd love to hear your opinions, discus improvements, architecture, theory, internal implementation, etc. Please, join or start a new conversation in our [issue tracker](https://github.com/kriasoft/react-starter-kit/issues), [Gitter](https://gitter.im/kriasoft/react-starter-kit) chat room, or let's talk face-to-face on -[Appear.in](https://appear.in/react) or [Skype](http://hatscripts.com/addskype?koistya). +[Appear.in](https://appear.in/react) or [Skype](http://hatscripts.com/addskype?koistya). ### Documentation diff --git a/LICENSE.txt b/LICENSE.txt @@ -1,4 +1,4 @@ - The MIT License +The MIT License Copyright (c) 2014-2016 Konstantin Tarkus, KriaSoft LLC. diff --git a/package.json b/package.json @@ -57,6 +57,7 @@ "chai": "^3.5.0", "chokidar": "^1.6.1", "css-loader": "^0.26.0", + "editorconfig-tools": "^0.1.1", "enzyme": "^2.6.0", "eslint": "^3.10.2", "eslint-config-airbnb": "^13.0.0", @@ -71,6 +72,7 @@ "git-repository": "^0.1.4", "glob": "^7.1.1", "json-loader": "^0.5.4", + "lint-staged": "^3.2.2", "markdown-it": "^8.2.2", "mkdirp": "^0.5.1", "mocha": "^3.1.2", @@ -92,6 +94,7 @@ "postcss-selector-matches": "^2.0.5", "postcss-selector-not": "^2.0.0", "postcss-url": "^5.1.2", + "pre-commit": "^1.2.2", "raw-loader": "^0.5.1", "react-addons-test-utils": "15.4.1", "react-deep-force-update": "^2.0.1", @@ -99,6 +102,7 @@ "redbox-react": "^1.3.3", "rimraf": "^2.5.4", "sinon": "^2.0.0-pre.3", + "stylefmt": "^5.0.2", "stylelint": "^7.6.0", "stylelint-config-standard": "^15.0.0", "url-loader": "^0.5.7", @@ -178,9 +182,26 @@ ] } }, + "pre-commit": "lint:staged", + "lint-staged": { + "*": [ + "editorconfig-tools fix", + "git add" + ], + "*.{js,jsx}": [ + "eslint --fix", + "git add" + ], + "*.{css,less,scss,sss}": [ + "stylefmt", + "stylelint", + "git add" + ] + }, "scripts": { "lint:js": "eslint src tools", "lint:css": "stylelint \"src/**/*.{css,less,scss,sss}\"", + "lint:staged": "lint-staged", "lint": "npm run lint:js && npm run lint:css", "test": "mocha \"src/**/*.test.js\" --require babel-register --require test/setup.js", "test:watch": "npm run test -- --reporter min --watch",