Skip to content

Node.js based forum software built for the modern web

using husky+lint-staged for enforced linting mwahahahah

Julian Lamfb6009eceb26
diff --git a/install/package.json b/install/package.json
index e386595c67..9cc61b131c 100644
--- a/install/package.json
+++ b/install/package.json
@@ -14,7 +14,14 @@
"lint": "eslint --cache ./nodebb .",
"pretest": "npm run lint",
"test": "nyc --reporter=html --reporter=text-summary mocha",
- "coveralls": "nyc report --reporter=text-lcov | coveralls && rm -r coverage"
+ "coveralls": "nyc report --reporter=text-lcov | coveralls && rm -r coverage",
+ "precommit": "lint-staged"
+ },
+ "lint-staged": {
+ "*.js": [
+ "eslint --fix",
+ "git add"
+ ]
},
"dependencies": {
"ace-builds": "^1.2.9",
@@ -123,7 +130,9 @@
"eslint-plugin-import": "2.14.0",
"grunt": "1.0.3",
"grunt-contrib-watch": "1.1.0",
+ "husky": "^1.1.2",
"jsdom": "12.2.0",
+ "lint-staged": "^7.3.0",
"mocha": "5.2.0",
"mocha-lcov-reporter": "1.3.0",
"nyc": "13.0.1",