diff --git a/.stylintrc b/.stylintrc index 481cbd3a2..a599ced3a 100644 --- a/.stylintrc +++ b/.stylintrc @@ -28,18 +28,13 @@ "placeholders": false, "prefixVarsWithDollar": "never", "quotePref": false, - "reporterOptions": { - "columns": ["lineData", "severity", "description", "rule"], - "columnSplitter": " ", - "showHeaders": false, - "truncate": true - }, + "reporter": "stylint-stylish", "semicolons": "never", "sortOrder": false, "stackedProperties": "never", "trailingWhitespace": "never", "universal": false, - "valid": true, + "valid": false, "zeroUnits": "never", "zIndexNormalize": false } diff --git a/gulpfile.js b/gulpfile.js index 6d3efb0f9..61d28a219 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,8 +1,9 @@ 'use strict'; +/* eslint no-console: 0 */ const path = require('path'), {spawn} = require('child_process'), - + gulp = require('gulp'), concat = require('gulp-concat'), sourcemaps = require('gulp-sourcemaps'), @@ -13,7 +14,7 @@ const path = require('path'), gulpif = require('gulp-if'), eslint = require('gulp-eslint'), stylint = require('gulp-stylint'), - + streamQueue = require('streamqueue'), notifier = require('node-notifier'), fs = require('fs-extra'), @@ -74,7 +75,7 @@ const compileStylus = () => .pipe(sourcemaps.write()) .pipe(gulp.dest('./app/data/')); -const compilePug = () => +const compilePug = () => gulp.src('./src/pug/*.pug') .pipe(sourcemaps.init()) .pipe(pug({ @@ -104,6 +105,7 @@ const compileScripts = gulp.series(compileRiot, () => .pipe(gulpif(releasing, sourcemaps.init())) .pipe(concat('bundle.js')) .pipe(gulpif(releasing, sourcemaps.write())) + /* eslint camelcase: 0 */ .pipe(gulpif(releasing, closureCompiler({ compilation_level: 'SIMPLE', language_in: 'ECMASCRIPT_NEXT', @@ -174,7 +176,9 @@ const build = gulp.parallel([compilePug, compileStylus, compileScripts]); const lintStylus = () => gulp.src(['./src/styl/**/*.styl', '!./src/styl/3rdParty/**/*.styl']) .pipe(stylint()) .pipe(stylint.reporter()) - .pipe(stylint.reporter('fail')); + .pipe(stylint.reporter('fail', { + failOnWarning: true + })); const lintJS = () => gulp.src(['./src/js/**/*.js', '!./src/js/3rdparty/**/*.js']) .pipe(eslint()) diff --git a/package-lock.json b/package-lock.json index 5b5f15c8d..982df99e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5491,6 +5491,11 @@ "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, "lodash.keys": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", @@ -5571,6 +5576,47 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "requires": { + "chalk": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -8133,6 +8179,51 @@ } } }, + "stylint-stylish": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stylint-stylish/-/stylint-stylish-2.0.0.tgz", + "integrity": "sha512-o940rcLoHlAfCoMHDNgl7QCYp44TBnHh0fv/H/InVLnbh/W25/lHbFUJpGLy7iwWchMN3ZIxR8wC28CuxnjzIg==", + "requires": { + "chalk": "^2.0.1", + "lodash.isnumber": "^3.0.3", + "log-symbols": "^2.0.0", + "path-is-absolute": "^1.0.1", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "stylus": { "version": "0.54.5", "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.5.tgz", diff --git a/package.json b/package.json index e46aba848..39b82dfbe 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "pug-lint-config-clock": "^2.0.0", "riot": "^3.13.2", "streamqueue": "^1.1.2", + "stylint-stylish": "^2.0.0", "stylus": "^0.54.5" } } diff --git a/src/styl/buildingBlocks.styl b/src/styl/buildingBlocks.styl index 85da91bba..7a94130c7 100644 --- a/src/styl/buildingBlocks.styl +++ b/src/styl/buildingBlocks.styl @@ -35,7 +35,7 @@ backface-visibility hidden max-height 90% overflow auto - box-shadow 0 2px 5px rgba(0,0,0, 0.35) + box-shadow 0 2px 5px rgba(0, 0, 0, 0.35) .view overflow auto @@ -64,7 +64,7 @@ border-bottom 1px solid bl if theme == 'Night' border-bottom 1px solid bd - + // Меню выбора - список .menu @@ -172,7 +172,7 @@ background rgba(act, 0.35) .aStyleIcon position relative - img + img max-width 100% max-height 100% position absolute diff --git a/src/styl/inputs.styl b/src/styl/inputs.styl index c793be93c..65e9fb828 100644 --- a/src/styl/inputs.styl +++ b/src/styl/inputs.styl @@ -271,14 +271,14 @@ input[type="range"] width 100% height 24px cursor pointer - background #f5f5f5 - border-radius 6px - border 1px solid #dcdcdc + background snow + border-radius br + border 1px solid bl &::-webkit-slider-thumb - border 1px solid #dcdcdc + border 1px solid bd height 40px width 19px - border-radius 6px + border-radius br background white cursor pointer -webkit-appearance none @@ -323,11 +323,13 @@ input[type="range"] top 0 bottom 0 background rgba(white, 0.65) + // @stylint off background-image: linear-gradient(to right, accent1 0, accent1 35%, transparent 35%, transparent 100%), linear-gradient(to left, accent1 0, accent1 35%, transparent 35%, transparent 100%), linear-gradient(to bottom, accent1 0, accent1 35%, transparent 35%, transparent 100%), linear-gradient(to top, accent1 0, accent1 35%, transparent 35%, transparent 100%) + // @stylint on background-size 5rem 0.5rem, 5rem 0.5rem, 0.5rem 5rem, 0.5rem 5rem background-repeat repeat-x, repeat-x, repeat-y, repeat-y background-position 0 0, 0 bottom, right 0, 0 0 diff --git a/src/styl/tags/font-editor.styl b/src/styl/tags/font-editor.styl index 34ce60927..7c38b7e34 100644 --- a/src/styl/tags/font-editor.styl +++ b/src/styl/tags/font-editor.styl @@ -4,7 +4,7 @@ font-editor .left text-align inherit width 15rem - flex 1 0 auto + flex 1 0 auto .right text-align inherit p diff --git a/src/styl/tags/hello.styl b/src/styl/tags/hello.styl index 3f60b9fcb..546faeb88 100644 --- a/src/styl/tags/hello.styl +++ b/src/styl/tags/hello.styl @@ -20,7 +20,7 @@ list-style none display inline-block position relative - padding 0.35em 0.5em 1em + padding 0.35em .5em 1em background snow border 1px solid bd border-radius br diff --git a/src/styl/tags/method-selector.styl b/src/styl/tags/method-selector.styl index 01e557427..91d93c4fe 100644 --- a/src/styl/tags/method-selector.styl +++ b/src/styl/tags/method-selector.styl @@ -8,7 +8,7 @@ method-selector bottom 5rem .panel padding 1rem - box-shadow 0 1rem 2rem rgba(#000, 0.35) + box-shadow 0 1rem 2rem rgba(black, 0.35) height 100% .flexfix-header padding-bottom 1rem \ No newline at end of file diff --git a/src/styl/tags/notepad-panel.styl b/src/styl/tags/notepad-panel.styl index 3007518a6..3649c5f39 100644 --- a/src/styl/tags/notepad-panel.styl +++ b/src/styl/tags/notepad-panel.styl @@ -30,7 +30,9 @@ notepad-panel width 100% height 100% border 0 none + // @stylint off background #fff + // @stylint on .aHomeButton position absolute right 0.5rem diff --git a/src/styl/tags/preview-screen.styl b/src/styl/tags/preview-screen.styl index f3f37fcdf..11234aa27 100644 --- a/src/styl/tags/preview-screen.styl +++ b/src/styl/tags/preview-screen.styl @@ -5,14 +5,14 @@ flex 1 1 280px img margin-bottom 0.5rem - display: inline-block !important + display inline-block !important if theme == 'Night' border 1rem solid act margin 0 0 2rem preview-modal width 45rem padding 2rem 2rem 1rem - .toright span + .toright span cursor pointer &:hover color act \ No newline at end of file diff --git a/src/styl/tags/project-selector.styl b/src/styl/tags/project-selector.styl index 547ce8eb8..01237e647 100644 --- a/src/styl/tags/project-selector.styl +++ b/src/styl/tags/project-selector.styl @@ -32,7 +32,9 @@ project-selector width 100% text-align center z-index 100 + // @stylint off color #fff + // @stylint on * vertical-align text-bottom i diff --git a/src/styl/tags/room-editor.styl b/src/styl/tags/room-editor.styl index d23debe4c..7f7ae7199 100644 --- a/src/styl/tags/room-editor.styl +++ b/src/styl/tags/room-editor.styl @@ -4,7 +4,7 @@ room-editor .room-editor-TypeSwatches .aSearchWrap display block flex 1 1 100% - margin 0 0 3px 0 + margin 0 0 3px input box-sizing border-box width 100% @@ -97,7 +97,7 @@ room-editor margin-top 0.85rem display block padding-bottom 0.5rem - span + span display block text-overflow ellipsis overflow hidden @@ -117,7 +117,7 @@ room-editor height 64px width 64px &.filler - height 0px + height 0 visibility hidden .room-editor-Backgrounds @@ -169,7 +169,7 @@ room-editor &:hover color act {transshort} - .flexfix-footer button + .flexfix-footer button margin-bottom 0.25rem select padding 0.25rem \ No newline at end of file diff --git a/src/styl/themeNight.styl b/src/styl/themeNight.styl index b014e9e32..d12ab1cb5 100644 --- a/src/styl/themeNight.styl +++ b/src/styl/themeNight.styl @@ -25,7 +25,7 @@ white = #08080D act = #44dbb5 acttext = act accent1 = #44dbb5 -accent2 = #446adb +accent2 = #446adb error = #d44f57 red = error success = #58E875 diff --git a/src/styl/typography.styl b/src/styl/typography.styl index da05c45a1..be72368b9 100644 --- a/src/styl/typography.styl +++ b/src/styl/typography.styl @@ -28,7 +28,7 @@ pre code font-family font-mono &.inline - padding 1.5px .5rem + padding 1.5px 0.5rem margin 0 0.25rem border-radius br background bl