Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Commit

Permalink
by iamdroid: Added SASS/JS linting Gulp task.
Browse files Browse the repository at this point in the history
  • Loading branch information
i-amdroid committed May 8, 2018
1 parent 86e61df commit 026b5b9
Show file tree
Hide file tree
Showing 25 changed files with 639 additions and 82 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
js/animation.js
js/jquery.mobile-events.min.js
js/jquery.ripple.js
js/misc.js
js/prism.js
41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"extends": "eslint-config-airbnb",
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"globals": {
"Drupal": true,
"drupalSettings": true,
"drupalTranslations": true,
"domready": true,
"jQuery": true,
"_": true,
"matchMedia": true,
"Backbone": true,
"Modernizr": true,
"CKEDITOR": true
},
"rules": {
"consistent-return": [0],
"no-underscore-dangle": [0],
"max-nested-callbacks": [1, 3],
"import/no-mutable-exports": [1],
"no-plusplus": [1, {
"allowForLoopAfterthoughts": true
}],
"no-param-reassign": [0],
"no-prototype-builtins": [0],
"valid-jsdoc": [1, {
"prefer": {
"returns": "return",
"property": "prop"
},
"requireReturn": false
}],
"brace-style": ["error", "stroustrup"],
"no-unused-vars": [1]
}
}
93 changes: 93 additions & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
options:
formatter: stylish
rules:
# Extends
extends-before-mixins: 1
extends-before-declarations: 1
placeholder-in-extend: 1

# Mixins
mixins-before-declarations: 1

# Line Spacing
one-declaration-per-line: 1
empty-line-between-blocks: 1
single-line-per-selector: 1

# Disallows
no-attribute-selectors: 0
no-color-hex: 0
no-color-keywords: 1
no-color-literals: 1
no-combinators: 0
no-css-comments: 0
no-debug: 1
no-disallowed-properties: 0
no-duplicate-properties: 0
no-empty-rulesets: 1
no-extends: 0
no-ids: 0
no-important: 1
no-invalid-hex: 1
no-mergeable-selectors: 1
no-misspelled-properties: 1
no-qualifying-elements: 1
no-trailing-whitespace: 1
no-trailing-zero: 1
no-transition-all: 1
no-universal-selectors: 0
no-url-domains: 1
no-url-protocols: 1
no-vendor-prefixes: 0
no-warn: 1
property-units: 0

# Nesting
declarations-before-nesting: 1
force-attribute-nesting: 1
force-element-nesting: 1
force-pseudo-nesting: 1

# Name Formats
class-name-format: 1
function-name-format: 1
id-name-format: 0
mixin-name-format: 1
placeholder-name-format: 1
variable-name-format: 1

# Style Guide
attribute-quotes: 1
bem-depth: 0
border-zero: 1
brace-style: 1
clean-import-paths: 1
empty-args: 1
hex-length: 1
hex-notation: 1
indentation: 1
leading-zero: 0
max-line-length: 0
max-file-line-count: 0
nesting-depth: 1
property-sort-order: 1
pseudo-element: 0
quotes: 1
shorthand-values: 1
url-quotes: 1
variable-for-property: 1
zero-unit: 1

# Inner Spacing
space-after-comma: 0
space-before-colon: 1
space-after-colon: 1
space-before-brace: 1
space-before-bang: 1
space-after-bang: 1
space-between-parens: 1
space-around-operator: 1

# Final Items
trailing-semicolon: 1
final-newline: 1
2 changes: 1 addition & 1 deletion css/code-highlight.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* break points */
/* mixins and functions */
@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700&subset=latin,cyrillic-ext);
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono:400,700&subset=latin,cyrillic-ext");
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+apacheconf+c+bash+cpp+csharp+ruby+css-extras+git+java+json+markdown+nginx+php+php-extras+sass+scss+twig+yaml&plugins=line-numbers */
/**
* prism.js default theme for JavaScript, CSS and HTML
Expand Down
70 changes: 54 additions & 16 deletions css/color-themes.css

Large diffs are not rendered by default.

36 changes: 24 additions & 12 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@charset "UTF-8";
@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=latin,cyrillic);
@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
@import url("https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=latin,cyrillic");
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
Expand Down Expand Up @@ -1471,23 +1471,25 @@ tr.selected:hover {
color: rgba(0, 0, 0, 0.87);
font-family: "Roboto", sans-serif;
font-size: 16px; }
.form-item input[type="text"], .form-item input[type="email"], .form-item input[type="password"], .form-item textarea, .form-item select {
.form-item input[type="text"], .form-item input[type="email"], .form-item input[type="password"], .form-item input[type="search"], .form-item input[type="tel"], .form-item textarea, .form-item select {
display: block;
width: 100%;
max-width: 460px;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
padding: 8px 0; }
.form-item input[type="text"]:focus, .form-item input[type="text"].error:focus, .form-item input[type="email"]:focus, .form-item input[type="email"].error:focus, .form-item input[type="password"]:focus, .form-item input[type="password"].error:focus, .form-item textarea:focus, .form-item textarea.error:focus, .form-item select:focus, .form-item select.error:focus {
.form-item input[type="text"]:focus, .form-item input[type="text"].error:focus, .form-item input[type="email"]:focus, .form-item input[type="email"].error:focus, .form-item input[type="password"]:focus, .form-item input[type="password"].error:focus, .form-item input[type="search"]:focus, .form-item input[type="search"].error:focus, .form-item input[type="tel"]:focus, .form-item input[type="tel"].error:focus, .form-item textarea:focus, .form-item textarea.error:focus, .form-item select:focus, .form-item select.error:focus {
border-bottom: 2px solid #00b0ff;
padding-bottom: 7px; }
.form-item input[type="text"].error, .form-item input[type="email"].error, .form-item input[type="password"].error, .form-item textarea.error, .form-item select.error {
.form-item input[type="text"].error, .form-item input[type="email"].error, .form-item input[type="password"].error, .form-item input[type="search"].error, .form-item input[type="tel"].error, .form-item textarea.error, .form-item select.error {
border-bottom: 2px solid #f44336;
padding: 8px 0 7px; }
.form-item input[type="text"]::-webkit-input-placeholder, .form-item input[type="email"]::-webkit-input-placeholder, .form-item input[type="password"]::-webkit-input-placeholder, .form-item textarea::-webkit-input-placeholder, .form-item select::-webkit-input-placeholder {
.form-item input[type="text"]::-webkit-input-placeholder, .form-item input[type="email"]::-webkit-input-placeholder, .form-item input[type="password"]::-webkit-input-placeholder, .form-item input[type="search"]::-webkit-input-placeholder, .form-item input[type="tel"]::-webkit-input-placeholder, .form-item textarea::-webkit-input-placeholder, .form-item select::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.form-item input[type="text"]:-ms-input-placeholder, .form-item input[type="email"]:-ms-input-placeholder, .form-item input[type="password"]:-ms-input-placeholder, .form-item textarea:-ms-input-placeholder, .form-item select:-ms-input-placeholder {
.form-item input[type="text"]:-ms-input-placeholder, .form-item input[type="email"]:-ms-input-placeholder, .form-item input[type="password"]:-ms-input-placeholder, .form-item input[type="search"]:-ms-input-placeholder, .form-item input[type="tel"]:-ms-input-placeholder, .form-item textarea:-ms-input-placeholder, .form-item select:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.form-item input[type="text"]::placeholder, .form-item input[type="email"]::placeholder, .form-item input[type="password"]::placeholder, .form-item textarea::placeholder, .form-item select::placeholder {
.form-item input[type="text"]::-ms-input-placeholder, .form-item input[type="email"]::-ms-input-placeholder, .form-item input[type="password"]::-ms-input-placeholder, .form-item input[type="search"]::-ms-input-placeholder, .form-item input[type="tel"]::-ms-input-placeholder, .form-item textarea::-ms-input-placeholder, .form-item select::-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.form-item input[type="text"]::placeholder, .form-item input[type="email"]::placeholder, .form-item input[type="password"]::placeholder, .form-item input[type="search"]::placeholder, .form-item input[type="tel"]::placeholder, .form-item textarea::placeholder, .form-item select::placeholder {
color: rgba(0, 0, 0, 0.26); }
.form-item input[type="radio"], .form-item input[type="checkbox"] {
display: inline-block;
Expand Down Expand Up @@ -1759,7 +1761,7 @@ tr.selected:hover {
margin: 160px auto 160px; }

.header-bg-image #header {
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 64px), #607d8b url(../img/header-bg.jpg) top center;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 64px), #607d8b url(../img/header-bg.jpg) top center;
background-size: auto, cover; }

.header-bg-image #bg-video {
Expand All @@ -1776,7 +1778,7 @@ tr.selected:hover {

.header-bg-image.navbar-fixed #header-bg {
display: block;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 64px), url(../img/header-bg.jpg) top center;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 64px), url(../img/header-bg.jpg) top center;
background-size: auto, cover;
opacity: 1;
top: 0;
Expand All @@ -1787,7 +1789,7 @@ tr.selected:hover {
z-index: -1; }

.header-bg-object #navbar {
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 64px); }
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 64px); }

.header-bg-object #header {
background: #607d8b; }
Expand Down Expand Up @@ -1845,7 +1847,7 @@ tr.selected:hover {
right: 0;
z-index: 1;
height: 64px;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 64px); }
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 64px); }

.main-shift-up #header {
padding-bottom: 128px; }
Expand Down Expand Up @@ -1956,6 +1958,10 @@ tr.selected:hover {
#header .block-search form .form-item input[type="text"]:-ms-input-placeholder,
.card-bg-primary .block-search form .form-item input[type="text"]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.navbar-item.block-search form .form-item input[type="text"]::-ms-input-placeholder,
#header .block-search form .form-item input[type="text"]::-ms-input-placeholder,
.card-bg-primary .block-search form .form-item input[type="text"]::-ms-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.navbar-item.block-search form .form-item input[type="text"]::placeholder,
#header .block-search form .form-item input[type="text"]::placeholder,
.card-bg-primary .block-search form .form-item input[type="text"]::placeholder {
Expand Down Expand Up @@ -2002,6 +2008,10 @@ tr.selected:hover {
#header .block-search.search-persistent form .form-item.focused input[type="text"]:-ms-input-placeholder,
.card-bg-primary .block-search.search-persistent form .form-item.focused input[type="text"]:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-item.block-search.search-persistent form .form-item.focused input[type="text"]::-ms-input-placeholder,
#header .block-search.search-persistent form .form-item.focused input[type="text"]::-ms-input-placeholder,
.card-bg-primary .block-search.search-persistent form .form-item.focused input[type="text"]::-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-item.block-search.search-persistent form .form-item.focused input[type="text"]::placeholder,
#header .block-search.search-persistent form .form-item.focused input[type="text"]::placeholder,
.card-bg-primary .block-search.search-persistent form .form-item.focused input[type="text"]::placeholder {
Expand All @@ -2019,6 +2029,8 @@ tr.selected:hover {
color: rgba(0, 0, 0, 0.26); }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="text"]:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="text"]::-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="text"]::placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item.icon-left:before {
Expand Down
14 changes: 9 additions & 5 deletions css/theme-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,17 @@
color: #FFF; }
.theme-dark .form-item select option {
color: rgba(0, 0, 0, 0.87); }
.theme-dark .form-item input[type="text"], .theme-dark .form-item input[type="email"], .theme-dark .form-item input[type="password"], .theme-dark .form-item textarea, .theme-dark .form-item select {
.theme-dark .form-item input[type="text"], .theme-dark .form-item input[type="email"], .theme-dark .form-item input[type="password"], .theme-dark .form-item input[type="search"], .theme-dark .form-item input[type="tel"], .theme-dark .form-item textarea, .theme-dark .form-item select {
border-bottom-color: rgba(255, 255, 255, 0.12); }
.theme-dark .form-item input[type="text"]:focus, .theme-dark .form-item input[type="text"].error:focus, .theme-dark .form-item input[type="email"]:focus, .theme-dark .form-item input[type="email"].error:focus, .theme-dark .form-item input[type="password"]:focus, .theme-dark .form-item input[type="password"].error:focus, .theme-dark .form-item textarea:focus, .theme-dark .form-item textarea.error:focus, .theme-dark .form-item select:focus, .theme-dark .form-item select.error:focus {
.theme-dark .form-item input[type="text"]:focus, .theme-dark .form-item input[type="text"].error:focus, .theme-dark .form-item input[type="email"]:focus, .theme-dark .form-item input[type="email"].error:focus, .theme-dark .form-item input[type="password"]:focus, .theme-dark .form-item input[type="password"].error:focus, .theme-dark .form-item input[type="search"]:focus, .theme-dark .form-item input[type="search"].error:focus, .theme-dark .form-item input[type="tel"]:focus, .theme-dark .form-item input[type="tel"].error:focus, .theme-dark .form-item textarea:focus, .theme-dark .form-item textarea.error:focus, .theme-dark .form-item select:focus, .theme-dark .form-item select.error:focus {
border-bottom-color: #40c4ff; }
.theme-dark .form-item input[type="text"]::-webkit-input-placeholder, .theme-dark .form-item input[type="email"]::-webkit-input-placeholder, .theme-dark .form-item input[type="password"]::-webkit-input-placeholder, .theme-dark .form-item textarea::-webkit-input-placeholder, .theme-dark .form-item select::-webkit-input-placeholder {
.theme-dark .form-item input[type="text"]::-webkit-input-placeholder, .theme-dark .form-item input[type="email"]::-webkit-input-placeholder, .theme-dark .form-item input[type="password"]::-webkit-input-placeholder, .theme-dark .form-item input[type="search"]::-webkit-input-placeholder, .theme-dark .form-item input[type="tel"]::-webkit-input-placeholder, .theme-dark .form-item textarea::-webkit-input-placeholder, .theme-dark .form-item select::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.theme-dark .form-item input[type="text"]:-ms-input-placeholder, .theme-dark .form-item input[type="email"]:-ms-input-placeholder, .theme-dark .form-item input[type="password"]:-ms-input-placeholder, .theme-dark .form-item textarea:-ms-input-placeholder, .theme-dark .form-item select:-ms-input-placeholder {
.theme-dark .form-item input[type="text"]:-ms-input-placeholder, .theme-dark .form-item input[type="email"]:-ms-input-placeholder, .theme-dark .form-item input[type="password"]:-ms-input-placeholder, .theme-dark .form-item input[type="search"]:-ms-input-placeholder, .theme-dark .form-item input[type="tel"]:-ms-input-placeholder, .theme-dark .form-item textarea:-ms-input-placeholder, .theme-dark .form-item select:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.theme-dark .form-item input[type="text"]::placeholder, .theme-dark .form-item input[type="email"]::placeholder, .theme-dark .form-item input[type="password"]::placeholder, .theme-dark .form-item textarea::placeholder, .theme-dark .form-item select::placeholder {
.theme-dark .form-item input[type="text"]::-ms-input-placeholder, .theme-dark .form-item input[type="email"]::-ms-input-placeholder, .theme-dark .form-item input[type="password"]::-ms-input-placeholder, .theme-dark .form-item input[type="search"]::-ms-input-placeholder, .theme-dark .form-item input[type="tel"]::-ms-input-placeholder, .theme-dark .form-item textarea::-ms-input-placeholder, .theme-dark .form-item select::-ms-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.theme-dark .form-item input[type="text"]::placeholder, .theme-dark .form-item input[type="email"]::placeholder, .theme-dark .form-item input[type="password"]::placeholder, .theme-dark .form-item input[type="search"]::placeholder, .theme-dark .form-item input[type="tel"]::placeholder, .theme-dark .form-item textarea::placeholder, .theme-dark .form-item select::placeholder {
color: rgba(255, 255, 255, 0.3); }
.theme-dark .form-item input[type="radio"], .theme-dark .form-item input[type="checkbox"] {
color: rgba(255, 255, 255, 0.7); }
Expand Down Expand Up @@ -192,6 +194,8 @@
color: rgba(0, 0, 0, 0.26); }
.theme-dark .block-search.search-persistent form .form-item.focused input[type="text"]:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.theme-dark .block-search.search-persistent form .form-item.focused input[type="text"]::-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.theme-dark .block-search.search-persistent form .form-item.focused input[type="text"]::placeholder {
color: rgba(0, 0, 0, 0.26); }
.theme-dark .tabs ul li a, .theme-dark ul.tabs li a {
Expand Down
26 changes: 26 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
var gulp = require('gulp');
var sass = require('gulp-sass');
var sasslint = require('gulp-sass-lint');
var eslint = require('gulp-eslint');
var changed = require('gulp-changed');
var autoprefixer = require('gulp-autoprefixer');
var imagemin = require('gulp-imagemin');

var SASS = 'sass';
var CSS = 'css';
var IMG = 'img';
var JS = 'js';

gulp.task('sass-lint', function () {
return gulp.src(SASS + '/**/*.scss')
.pipe(sasslint())
.pipe(sasslint.format())
.pipe(sasslint.failOnError());
});

gulp.task('js-lint', function () {
return gulp.src(JS + '/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('sass', function () {
return gulp.src(SASS + '/**/*.scss')
Expand Down Expand Up @@ -37,4 +54,13 @@ gulp.task('watch', function() {
gulp.watch(SASS + '/**/*.scss', ['sass', 'autoprefixer', 'imagemin']);
});

gulp.task('build-lint', ['sass-lint', 'sass', 'autoprefixer', 'imagemin', 'js-lint']);

gulp.task('watch-lint', function() {
gulp.watch(SASS + '/**/*.scss', ['sass-lint', 'sass', 'autoprefixer', 'imagemin']);
gulp.watch(JS + '/**/*.js', ['js-lint']);
});

gulp.task('default', ['build', 'watch']);

//gulp.task('default', ['build-lint', 'watch-lint']);
4 changes: 2 additions & 2 deletions js/animation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function (window, $) {
$(function() {
$(function () {

});
})(window, jQuery);
}(window, jQuery));
Loading

0 comments on commit 026b5b9

Please sign in to comment.