From eb24fcae0ded1fc7d899d2ef152ac8cbae048269 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Fri, 8 Dec 2017 16:25:57 +0100 Subject: [PATCH] Added lesshint and exempted everything which is currently being violated --- .lesshintrc | 35 +++++++++++++++++++++++++++++++++++ package.json | 7 ++++--- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .lesshintrc diff --git a/.lesshintrc b/.lesshintrc new file mode 100644 index 000000000..8f743df8c --- /dev/null +++ b/.lesshintrc @@ -0,0 +1,35 @@ +{ + "fileExtensions": [".less"], + + // These rules are almost certainly crap and will not catch bugs (Caleb) + "finalNewline": false, + "newlineAfterBlock": false, + "spaceAroundOperator": false, + "hexLength": false, + "hexNotation": false, + "propertyOrdering": false, + "stringQuotes": false, + "importPath": false, + "qualifyingElement": false, + "decimalZero": false, + "borderZero": false, + + // These rules should be discussed, if they're crap then they should be moved up. + "zeroUnit": false, + "spaceAroundComma": false, + "singleLinePerProperty": false, + "importantRule": false, + "idSelector": false, + "singleLinePerSelector": false, + "spaceAfterPropertyColon": false, + "spaceBetweenParens": false, + "spaceBeforeBrace": false, + "universalSelector": false, + + // These rules are really good rules to have around IMO (Caleb) but they're not being honored. + "duplicateProperty": false, + "trailingSemicolon": false, + "emptyRule": false, + "maxCharPerLine": false, + "trailingWhitespace": false +} diff --git a/package.json b/package.json index c87e16e26..0b6f85d0a 100644 --- a/package.json +++ b/package.json @@ -11,15 +11,16 @@ "ws": "^1.0.1" }, "devDependencies": { + "flow-bin": "^0.59.0", "jshint": "~2.9.1", - "selenium-webdriver": "^2.53.1", "less": "2.7.1", - "flow-bin": "^0.59.0" + "lesshint": "^4.5.0", + "selenium-webdriver": "^2.53.1" }, "scripts": { "start": "node server.js", "dev": "DEV=1 node server.js", - "lint": "jshint --config .jshintrc --exclude-path .jshintignore .", + "lint": "jshint --config .jshintrc --exclude-path .jshintignore . && ./node_modules/lesshint/bin/lesshint -c ./.lesshintrc ./customize.dist/src/less2/", "flow": "./node_modules/.bin/flow", "test": "node TestSelenium.js", "template": "cd customize.dist/src && for page in ../index.html ../privacy.html ../terms.html ../about.html ../contact.html ../what-is-cryptpad.html ../../www/login/index.html ../../www/register/index.html ../../www/settings/index.html ../../www/user/index.html;do echo $page; cp template.html $page; done;"