Skip to content

Commit

Permalink
Adding linting configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ten1seven committed Sep 27, 2019
1 parent 25c3bf4 commit 0612dfe
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 75 deletions.
16 changes: 6 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# http://editorconfig.org/
# http://EditorConfig.org

root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
insert_final_newline = true
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["eslint:recommended"],
"parserOptions": {
"ecmaVersion": 2017
},

"env": {
"es6": true,
"node": true
}
}
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2
"singleQuote": true
}
9 changes: 9 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"rules": {
"at-rule-no-unknown": [true, {
ignoreAtRules: ['include', 'extend', 'mixin', 'function', 'return', 'for', 'if', 'else', 'warn']
}],
"no-descending-specificity": null
}
}
51 changes: 28 additions & 23 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,26 +148,31 @@ function deploy() {
* default task
*/

exports.default = gulp.series(clean, gulp.parallel(markup, scripts, styles, images))
// gulp.task('default', () => {
// gulp.series('clean', gulp.parallel('markup', 'scripts', 'styles', 'images'), () => {
// $.browserSync.init({
// server: {
// baseDir: './build/'
// }
// })

// gulp
// .watch(
// ['./src/scripts/what-input.js', './src/scripts/polyfills/*.js'],
// ['scripts']
// )
// .on('change', $.browserSync.reload)

// gulp.watch(['./src/styles/{,*/}{,*/}*.scss'], ['styles'])

// gulp
// .watch(['./src/markup/*.html'], ['markup'])
// .on('change', $.browserSync.reload)
// })
// })
function watch() {
$.browserSync.init({
server: {
baseDir: './build/'
}
})

gulp.watch(
['./src/scripts/what-input.js', './src/scripts/polyfills/*.js'],
scripts,
{ events: 'all' },
function() {
$.browserSync.reload
}
)

gulp.watch(['./src/styles/{,*/}{,*/}*.scss'], styles)

gulp.watch(['./src/markup/*.html'], markup, { events: 'all' }, function() {
$.browserSync.reload
})
}

exports.default = gulp.series(
clean,
gulp.parallel(markup, scripts, styles, images),
watch
)
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"gulp-sourcemaps": "^2.6.5",
"gulp-standard": "^14.0.0",
"gulp-uglify": "^3.0.2",
"stylelint-config-prettier": "^6.0.0",
"stylelint-config-standard": "^19.0.0",
"webpack-stream": "3.2.0"
}
}
3 changes: 2 additions & 1 deletion src/scripts/what-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ module.exports = (() => {
value = pointerType(event)
}

const ignoreMatch = !specificMap.length && ignoreMap.indexOf(eventKey) === -1
const ignoreMatch =
!specificMap.length && ignoreMap.indexOf(eventKey) === -1

const specificMatch =
specificMap.length && specificMap.indexOf(eventKey) !== -1
Expand Down
82 changes: 43 additions & 39 deletions src/styles/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

.well {
@include clearfix;

background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
Expand Down Expand Up @@ -52,46 +53,7 @@
padding-left: ($unit * 3);
width: 50%;
}
}

.list-group {
list-style: none;
padding: 0;
}

.list-group-item {
&:first-child a {
border-radius: 4px 4px 0 0;
}

&:last-child a {
border-bottom: 1px solid #ddd;
border-radius: 0 0 4px 4px;
}

a {
@include a11y-focus;
background-color: #fff;
border: 1px solid #ddd;
border-bottom: none;
color: #555;
display: block;
padding: ($unit * 2) ($unit * 2);
text-decoration: none;
transition: all 0.2s ease;

@include hover {
background-color: #f5f5f5;
}

&:active,
&:focus {
position: relative;
}
}
}

.well-column {
button {
appearance: none;
background-color: #337ab7;
Expand Down Expand Up @@ -132,6 +94,7 @@
input {
&:not([type='submit']):not([type='checkbox']):not([type='radio']) {
@include input-style-base;

box-shadow: inset 0 1px 1px rgba(#000, 0.075);
transition: all 0.2s ease;

Expand All @@ -153,6 +116,7 @@

select {
@include input-style-base;

background-image: url(../images/select-arrow.svg);
background-position: calc(100% - 10px) 50%;
background-repeat: no-repeat;
Expand Down Expand Up @@ -182,6 +146,7 @@

textarea {
@include input-style-base;

box-shadow: inset 0 1px 1px rgba(#000, 0.075);
height: 5em;
padding-bottom: $unit;
Expand All @@ -200,8 +165,47 @@
}
}

.list-group {
list-style: none;
padding: 0;
}

.list-group-item {
&:first-child a {
border-radius: 4px 4px 0 0;
}

&:last-child a {
border-bottom: 1px solid #ddd;
border-radius: 0 0 4px 4px;
}

a {
@include a11y-focus;

background-color: #fff;
border: 1px solid #ddd;
border-bottom: none;
color: #555;
display: block;
padding: ($unit * 2) ($unit * 2);
text-decoration: none;
transition: all 0.2s ease;

@include hover {
background-color: #f5f5f5;
}

&:active,
&:focus {
position: relative;
}
}
}

footer {
@include clearfix;

font-size: 14px;
margin: ($unit * 4) 0;

Expand Down
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7194,6 +7194,23 @@ strip-json-comments@~2.0.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=

stylelint-config-prettier@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/stylelint-config-prettier/-/stylelint-config-prettier-6.0.0.tgz#600aa218d8e34cf44a025903b0f60c079fd83366"
integrity sha512-f/BKiUAczB4KODC1w5eY6LoNgfq6QzdSnSc4ccAATKo1IfYCuG3IZwaxj/5AAxl1kyaW7kPLBOXG66O4gSIKTQ==

stylelint-config-recommended@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz#e0e547434016c5539fe2650afd58049a2fd1d657"
integrity sha512-F6yTRuc06xr1h5Qw/ykb2LuFynJ2IxkKfCMf+1xqPffkxh0S09Zc902XCffcsw/XMFq/OzQ1w54fLIDtmRNHnQ==

stylelint-config-standard@^19.0.0:
version "19.0.0"
resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-19.0.0.tgz#66f0cf13f33b8a9e34965881493b38fc1313693a"
integrity sha512-VvcODsL1PryzpYteWZo2YaA5vU/pWfjqBpOvmeA8iB2MteZ/ZhI1O4hnrWMidsS4vmEJpKtjdhLdfGJmmZm6Cg==
dependencies:
stylelint-config-recommended "^3.0.0"

supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
Expand Down

0 comments on commit 0612dfe

Please sign in to comment.