From 611fbef45e7533a4e2503250ea08fe7d694b9825 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 27 Jul 2018 21:48:42 +0100 Subject: [PATCH] Link SCSS and JS --- .eslintrc | 10 ++++++++ .sass-lint.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 2 ++ scripts/tests.sh | 6 +++++ 4 files changed, 83 insertions(+) create mode 100644 .eslintrc create mode 100644 .sass-lint.yml diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..a311e5b --- /dev/null +++ b/.eslintrc @@ -0,0 +1,10 @@ +{ + "extends": [ + "dabapps/commonjs", + "dabapps/browser" + ], + "globals": { + "mermaid": true + + } +} diff --git a/.sass-lint.yml b/.sass-lint.yml new file mode 100644 index 0000000..1b3ad0a --- /dev/null +++ b/.sass-lint.yml @@ -0,0 +1,65 @@ +files: + include: 'static/src/scss/**/*.scss' + +rules: + clean-import-paths: 0 + extends-before-mixins: 2 + extends-before-declarations: 2 + force-attribute-nesting: 0 + no-css-comments: 0 + no-debug: 1 + no-duplicate-properties: + - 2 + - + exclude: + - src + - transform + no-ids: 0 + no-important: 0 + no-transition-all: 0 + no-vendor-prefixes: 2 + no-qualifying-elements: 0 + no-url-protocols: 0 + no-warn: 1 + hex-notation: + - 2 + - + style: uppercase + indentation: + - 2 + - + size: 2 + variable-name-format: + - 2 + - + allow-leading-underscore: false + convention: hyphenatedlowercase + quotes: + - 2 + - + style: double + property-sort-order: + - 2 + - + order: 'concentric' + empty-line-between-blocks: 2 + space-after-bang: 2 + space-after-colon: 2 + space-after-comma: 2 + space-before-bang: 2 + space-before-brace: 2 + space-before-colon: 2 + space-between-parens: 2 + trailing-semicolon: 2 + leading-zero: 0 + single-line-per-selector: 0 + force-pseudo-nesting: 0 + force-element-nesting: 0 + placeholder-in-extend: 0 + no-url-domains: 0 + no-color-literals: 2 + class-name-format: 2 + nesting-depth: + - 2 + - + max-depth: 5 diff --git a/Dockerfile b/Dockerfile index ae2eb36..c2d22e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,8 @@ COPY project/ /app/project/ COPY static/ /app/static/ COPY scripts/ /app/scripts/ COPY templates/ /app/templates/ +COPY .sass-lint.yml /app/.sass-lint.yml +COPY .eslintrc /app/.eslintrc RUN BASE_URL= ./scripts/build-static.sh diff --git a/scripts/tests.sh b/scripts/tests.sh index 274b624..0534c92 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -12,3 +12,9 @@ flake8 project --ignore=E128,E501 --exclude=migrations,wsgi.py echo ">> Running backend unit tests..." coverage run --source=project --omit='*/wsgi.py,*/settings.py,*/migrations/*.py,*__init__.py' manage.py test $@ coverage report + +echo ">> Linting SCSS..." +sass-lint -vqc .sass-lint.yml + +echo ">> Linting JS..." +eslint $STATIC_SRC/js