From 088499ab3f9f2af9d4a902adb5117ad7bd3aa679 Mon Sep 17 00:00:00 2001 From: Diego Islas Ocampo Date: Fri, 7 Jul 2017 22:30:13 -0500 Subject: [PATCH 01/92] Add linters and apply rules --- .editorconfig | 2 +- .eslintrc.json | 90 +++++ .gitignore | 1 + .htmlhintrc | 18 + .stylelintrc | 25 ++ index.html | 43 ++- js/artemis.min.js | 12 +- js/jquery.min.js | 2 +- js/monogatari.js | 808 ++++++++++++++++++++++--------------------- js/options.js | 29 +- js/plugins.js | 6 - js/script.js | 48 ++- js/strings.js | 6 +- package.json | 4 +- service-worker.js | 96 ++--- style/monogatari.css | 28 +- 16 files changed, 692 insertions(+), 526 deletions(-) create mode 100644 .eslintrc.json create mode 100644 .htmlhintrc create mode 100644 .stylelintrc delete mode 100755 js/plugins.js diff --git a/.editorconfig b/.editorconfig index b82ac3e..f5ebc44 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,4 +6,4 @@ insert_final_newline = false trim_trailing_whitespace = true charset = utf-8 indent_size = 4 -indent_style = tab +indent_style = tab \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..623f4db --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,90 @@ +{ + "rules": { + "dot-notation": [ + 2 + ], + "indent": [ + 2, + "tab", + { + "SwitchCase": 1, + "ObjectExpression": "first" + } + ], + "quotes": [ + 2, + "double" + ], + "linebreak-style": [ + 2, + "unix" + ], + "no-console": [ + 2, + { + "allow": ["warn", "error"] + } + ], + "no-eq-null":[ + 2 + ], + "no-eval":[ + 2 + ], + "no-implied-eval":[ + 2 + ], + "no-redeclare": [ + 2, + { + "builtinGlobals": true + } + ], + "one-var": [ + 2, + "never" + ], + "prefer-const":[ + 2 + ], + "semi": [ + 2, + "always" + ], + "keyword-spacing":[ + 2, + { + "before": true, + "after": true, + "overrides": { + "if": { + "before": false + }, + "for": { + "before": false + }, + "while": { + "before": false + } + } + } + ], + "space-before-blocks":[ + 2, + "always" + ], + "space-before-function-paren": [ + 2, + "always" + ], + "strict":[ + 2, + "global" + ] + }, + "env": { + "es6": true, + "browser": true + }, + "extends": "eslint:recommended" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 73a44e1..83ed193 100755 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ .thumbs .Thumbs .buildconfig +package-lock.json /node_modules /cache /src diff --git a/.htmlhintrc b/.htmlhintrc new file mode 100644 index 0000000..f8e53ab --- /dev/null +++ b/.htmlhintrc @@ -0,0 +1,18 @@ +{ + "tagname-lowercase": true, + "attr-lowercase": true, + "attr-value-double-quotes": true, + "doctype-first": true, + "tag-pair": true, + "spec-char-escape": true, + "id-unique": true, + "src-not-empty": true, + "attr-no-duplication": true, + "tag-pair": true, + "tag-self-close": false, + "title-require": true, + "doctype-html5": true, + "inline-style-disabled": true, + "space-tab-mixed-disabled": "tab", + "alt-require": true +} \ No newline at end of file diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 0000000..35ebc7d --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,25 @@ +{ + "rules": { + "block-closing-brace-empty-line-before": "never", + "block-closing-brace-newline-after": "always", + "declaration-block-semicolon-newline-after": "always", + "block-opening-brace-space-before": "always", + "color-hex-case": "lower", + "color-named": "never", + "color-no-invalid-hex": true, + "function-comma-newline-after": "never-multi-line", + "function-comma-space-after": "always", + "no-duplicate-selectors": true, + "no-eol-whitespace": true, + "indentation": "tab", + "number-leading-zero": "always", + "property-no-unknown": [ true, { + "ignoreProperties": [ + "composes" + ] + }], + "selector-list-comma-newline-after": "always", + "unit-case": "lower", + "unit-whitelist": ["em", "rem", "s", "vmax", "vmin", "vh", "vw", "%", "px"] + } +} \ No newline at end of file diff --git a/index.html b/index.html index 6de58cb..c0498f1 100755 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ - + @@ -24,9 +24,9 @@ - + - + @@ -59,7 +59,7 @@ - + @@ -78,7 +78,6 @@ - @@ -91,25 +90,25 @@