diff --git a/var/www/ip2country.info/.stylelintrc.yml b/var/www/ip2country.info/.stylelintrc.yml new file mode 100644 index 0000000..70f3d65 --- /dev/null +++ b/var/www/ip2country.info/.stylelintrc.yml @@ -0,0 +1,7 @@ +extends: stylelint-config-standard +rules: + indentation: 4 + max-empty-lines: 2 + number-leading-zero: never + rule-non-nested-empty-line-before: null + declaration-empty-line-before: null diff --git a/var/www/ip2country.info/gulpfile.js b/var/www/ip2country.info/gulpfile.js index 8427b66..dc067db 100755 --- a/var/www/ip2country.info/gulpfile.js +++ b/var/www/ip2country.info/gulpfile.js @@ -11,11 +11,11 @@ const htmlmin = require('gulp-htmlmin'), cleanCSS = require('gulp-clean-css'), htmlhint = require('gulp-htmlhint'), - uglify = require('gulp-uglify'), multipipe = require('multipipe'), zopfli = require('gulp-zopfli'), config = require('./config.json'), sourcemaps = require('gulp-sourcemaps'), + stylelint = require('gulp-stylelint'), browserSync = require('browser-sync').create(); @@ -28,8 +28,9 @@ gulp.task( 'scss:build', () => { gulp.src( config.scss.source ), sourcemaps.init(), + stylelint( { reporters: [ { formatter: 'string', console: true } ] } ), sass(), - sourcemaps.write( '.', {includeContent: false, sourceRoot: config.scss.root} ), + sourcemaps.write( '.', { includeContent: false, sourceRoot: config.scss.root } ), gulp.dest( config.css.path ), browserSync.stream() @@ -52,35 +53,33 @@ gulp.task( 'html:hint', () => { ).on( 'error', notify.onError() ); } ); -gulp.task( 'html:inline', ['html:hint'], () => { +gulp.task( 'html:inline', [ 'html:hint' ], () => { return multipipe( gulp.src( config.html.source ), - inline( { base: '.', js: uglify, css: cleanCSS } ), + inline( { base: '.', css: cleanCSS } ), gulp.dest( config.dest.path ) ).on( 'error', notify.onError() ); } ); -gulp.task( 'html:minify', ['html:inline'], () => { +gulp.task( 'html:minify', [ 'html:inline' ], () => { return multipipe( gulp.src( config.dest.path + config.html.source ), - htmlmin( - { - collapseWhitespace: true, - removeRedundantAttributes: true, - removeOptionalTags: true, - removeAttributeQuotes: true, - collapseBooleanAttributes: true - } - ), + htmlmin( { + collapseWhitespace: true, + removeRedundantAttributes: true, + removeOptionalTags: true, + removeAttributeQuotes: true, + collapseBooleanAttributes: true + } ), gulp.dest( config.dest.path ) ).on( 'error', notify.onError() ); } ); -gulp.task( 'html:compress', ['scss:build', 'html:minify'], () => { +gulp.task( 'html:compress', [ 'scss:build', 'html:minify' ], () => { return multipipe( gulp.src( config.dest.path + config.html.source ), @@ -108,17 +107,15 @@ gulp.task( 'copy:files', () => { * browserSync task */ -gulp.task('serve', ['scss:build'], () => { - browserSync.init( - { - server: true, - port: 3001, - browser: 'google chrome' - } - ); - - gulp.watch( config.scss.source, ['scss:build'] ); - gulp.watch( config.html.source, ['html:hint'], browserSync.reload ); +gulp.task('serve', [ 'scss:build' ], () => { + browserSync.init( { + server: true, + port: 3001, + browser: 'google chrome' + } ); + + gulp.watch( config.scss.source, [ 'scss:build' ] ); + gulp.watch( config.html.source, [ 'html:hint' ], browserSync.reload ); }); @@ -126,11 +123,11 @@ gulp.task('serve', ['scss:build'], () => { * Build task */ -gulp.task( 'build', ['scss:build', 'html:compress', 'copy:files'] ); +gulp.task( 'build', [ 'scss:build', 'html:compress', 'copy:files' ] ); /* * Default task */ -gulp.task( 'default', ['serve'] ); +gulp.task( 'default', [ 'serve' ] ); diff --git a/var/www/ip2country.info/package.json b/var/www/ip2country.info/package.json index fe41369..639b3f7 100644 --- a/var/www/ip2country.info/package.json +++ b/var/www/ip2country.info/package.json @@ -1,12 +1,12 @@ { "name": "IP2Country", "description": "Node.js modules for IP 2 Country project", - "version": "1.0.0", - "last-update": "30.07.2016", + "version": "1.1.0", + "last-update": "02.08.2016", "private": true, "repository": "sergejmueller/ip2country.info", "devDependencies": { - "browser-sync": "^2.12.3", + "browser-sync": "^2.14.0", "gulp": "^3.9.1", "gulp-clean-css": "^2.0.6", "gulp-htmlhint": "^0.3.1", @@ -14,11 +14,12 @@ "gulp-inline": "^0.1.1", "gulp-notify": "^2.2.0", "gulp-sass": "^2.2.0", - "gulp-scss-lint": "^0.4.0", "gulp-sourcemaps": "^1.6.0", - "gulp-uglify": "^1.5.3", + "gulp-stylelint": "^3.0.0", "gulp-zopfli": "^1.0.0", - "multipipe": "^0.3.0" + "multipipe": "^0.3.0", + "stylelint": "^7.1.0", + "stylelint-config-standard": "^12.0.0" }, "scripts": { "test": "npm outdated" diff --git a/var/www/ip2country.info/scss/styles.scss b/var/www/ip2country.info/scss/styles.scss index d60dda3..5d2be4c 100644 --- a/var/www/ip2country.info/scss/styles.scss +++ b/var/www/ip2country.info/scss/styles.scss @@ -112,6 +112,7 @@ td { border-bottom-left-radius: 3px; } } + &:last-child { background: $color-secondary; border-left: 1px solid $color-secondary;