From 87e01c171f1119a50307939ba8cff972f5dff6e2 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 5 Apr 2017 15:37:08 +0100 Subject: [PATCH] lint js and scss --- .gitignore | 1 + circle.yml | 4 ++++ md_pdf/assets/static/context.js | 4 ++++ package.json | 7 +++++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0a8eff8..c39891f 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,4 @@ md_pdf/assets/templates/cover.html md_pdf/assets/static/style.css md_pdf/assets/csl/ md_pdf/assets/styles-master/ +node_modules/ diff --git a/circle.yml b/circle.yml index 1e8238b..6ffe8d9 100644 --- a/circle.yml +++ b/circle.yml @@ -1,11 +1,14 @@ machine: python: version: 3.6.0 + node: + version: 6.10.2 dependencies: post: - pip install -r dev-requirements.txt + - npm install test: @@ -13,3 +16,4 @@ test: - flake8 md_pdf/ --ignore=E128,E501 - safety check - bandit -r md_pdf/ + - npm test diff --git a/md_pdf/assets/static/context.js b/md_pdf/assets/static/context.js index bb59599..90adc1b 100644 --- a/md_pdf/assets/static/context.js +++ b/md_pdf/assets/static/context.js @@ -1,3 +1,5 @@ +'use strict'; + function subst() { var vars = {}; var query_strings_from_url = document.location.search.substring(1).split('&'); @@ -18,3 +20,5 @@ function subst() { } } } + +window.subst = subst(); diff --git a/package.json b/package.json index e914b72..33e2150 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "private": true, "description": "", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "npm run lint-scss && npm run lint-js", + "lint-scss": "sass-lint -vq md_pdf/assets/static/**/*.scss", + "lint-js": "eslint -c eslint-config-dabapps/base/.eslintrc md_pdf/assets/static/**/*.js" }, "repository": { "type": "git", @@ -16,6 +18,7 @@ }, "homepage": "https://github.com/RealOrangeOne/md-pdf#readme", "devDependencies": { - "eslint-config": "dabapps/eslint-config.git#2.0.4" + "eslint-config": "dabapps/eslint-config.git#2.0.4", + "sass-lint": "1.10.2" } }