Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Commit

Permalink
Tweak ESLint rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jan 4, 2019
1 parent d45d882 commit 3bc1ce1
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.git/
/_site/
/node_modules/
/source/assets/js/vendor/
/source/assets/js/google-analytics.js
67 changes: 51 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
"env": {
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"extends": "eslint:recommended",
"rules": {
"array-bracket-spacing": ["error", "never"],
"array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": "error",
"arrow-body-style": [
"error",
"as-needed"
],
"arrow-parens": [
"error",
"always"
],
"arrow-spacing": "error",
"block-scoped-var": "error",
"block-spacing": "error",
"brace-style": [
Expand All @@ -35,19 +44,22 @@
"error",
"last"
],
"computed-property-spacing": ["error", "never"],
"consistent-return": "error",
"consistent-this": [
"computed-property-spacing": [
"error",
"this"
"never"
],
"consistent-return": "error",
"consistent-this": "off",
"curly": "error",
"default-case": "error",
"dot-notation": "error",
"eol-last": "error",
"eqeqeq": "error",
"func-call-spacing": "error",
"func-names": "off",
"func-names": [
"error",
"never"
],
"func-style": [
"error",
"declaration"
Expand All @@ -59,6 +71,7 @@
"error",
4,
{
"MemberExpression": "off",
"SwitchCase": 1
}
],
Expand Down Expand Up @@ -87,8 +100,16 @@
"max": 1
}
],
"multiline-ternary": "off",
"new-cap": "error",
"multiline-ternary": [
"off",
"always-multiline"
],
"new-cap": [
"error",
{
"properties": false
}
],
"newline-after-var": [
"error",
"always"
Expand Down Expand Up @@ -117,7 +138,13 @@
"no-eval": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "error",
"no-extra-parens": [
"error",
"all",
{
"nestedBinaryExpressions": false
}
],
"no-floating-decimal": "error",
"no-global-assign": "error",
"no-implicit-coercion": "error",
Expand Down Expand Up @@ -153,12 +180,13 @@
"no-new-object": "error",
"no-octal": "error",
"no-param-reassign": [
"error",
"off",
{
"props": false
}
],
"no-path-concat": "error",
"no-prototype-builtins": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
Expand Down Expand Up @@ -221,6 +249,10 @@
"single"
],
"radix": "error",
"rest-spread-spacing": [
"error",
"never"
],
"semi": [
"error",
"always"
Expand All @@ -231,17 +263,20 @@
"error",
"always"
],
"spaced-comment": [
"off",
"always"
"space-before-function-paren": [
"error",
"never"
],
"spaced-comment": "off",
"space-infix-ops": "error",
"space-in-parens": [
"error",
"never"
],
"space-unary-ops": "error",
"strict": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"unicode-bom": [
"error",
"never"
Expand Down
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = function(grunt) {
'use strict';

module.exports = function(grunt) {
grunt.initConfig({
dirs: {
dest: '_site',
Expand Down Expand Up @@ -227,7 +228,7 @@ module.exports = function(grunt) {
livereload: {
options: {
base: '<%= dirs.dest %>/',
open: true // Automatically open the webpage in the default browser
open: true // Automatically open the webpage in the default browser
}
}
},
Expand Down Expand Up @@ -352,5 +353,4 @@ module.exports = function(grunt) {
'connect',
'watch:dev'
]);

};
3 changes: 1 addition & 2 deletions source/assets/js/baguetteBox-init.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* global baguetteBox */

(function initBaguetteBox () {
(function() {
'use strict';

baguetteBox.run('.gallery', {
async: true,
buttons: true,
noScrollbars: true
});

})();
3 changes: 1 addition & 2 deletions source/assets/js/detect-os.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function detectOS () {
(function() {
'use strict';

var arch = window.navigator.userAgent.match(/x86_64|Win64|WOW64/) ||
Expand Down Expand Up @@ -36,5 +36,4 @@
href += arches[arch].folder + '/MPC-HC_v' + version + '_' + arch + '/MPC-HC.' + version + '.' + arch + '.exe';

downloadButton.setAttribute('href', encodeURI(href));

})();
11 changes: 5 additions & 6 deletions source/assets/js/downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(function() {

var $el = $('.toggleLink');

if (!$el.length) {
if ($el.length === 0) {
return;
}

Expand Down Expand Up @@ -40,15 +40,14 @@ $(function() {
});

$('.closeAll').click(function() {
$('.panel-collapse.in').collapse('hide'); // hide any `panel`s
collapsedToggleLinkCount = totalToggleLinkCount; // reset the global count
$('.panel-collapse.in').collapse('hide'); // hide any `panel`s
collapsedToggleLinkCount = totalToggleLinkCount; // reset the global count
checkButtonState();
});

$('.expandAll').click(function() {
$('.panel-collapse:not(".in")').collapse('show'); // show any `panel`s
collapsedToggleLinkCount = 0; // reset the global count
$('.panel-collapse:not(".in")').collapse('show'); // show any `panel`s
collapsedToggleLinkCount = 0; // reset the global count
checkButtonState();
});

});
2 changes: 1 addition & 1 deletion source/assets/js/no-js-class.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function nojs (html) {
(function(html) {
'use strict';

html.className = html.className.replace(/\bno-js\b/, '');
Expand Down
6 changes: 3 additions & 3 deletions source/assets/js/pwa.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint no-console:off */

(function setupSW () {
(function() {
'use strict';

if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.min.js').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
console.log('ServiceWorker registration failed: ', err);
}).catch(function(error) {
console.log('ServiceWorker registration failed: ', error);
});
});
}
Expand Down

0 comments on commit 3bc1ce1

Please sign in to comment.