From 9981e7da4fd195625e45929e4a5edcf2f1ffb4ff Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:05:01 +0200 Subject: [PATCH 1/9] Update eslintignore --- .eslintignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index 52369be1e..8e3aee83f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,5 @@ -libraries/ +node_modules +dist +.idea +.vscode +src/libraries From 441d0517b05a5c8f2cfe018ae6ca142f251470bf Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:05:29 +0200 Subject: [PATCH 2/9] Add JSON to EditorConfig --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index 81eba8ccc..92cf9dc59 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true end_of_line = lf + +[json] +indent_size = 2 From 5f04c783e544925b002cd2c99040cd7436605e82 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:06:56 +0200 Subject: [PATCH 3/9] Convert ESLint config to JavaScript --- .eslintrc.js | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++ .eslintrc.yml | 171 ----------------------------------------- 2 files changed, 205 insertions(+), 171 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.yml diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..78aa240e6 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,205 @@ +module.exports = { + root: true, + plugins: [ + 'promise', + 'import', + 'eslint-comments' + ], + env: { + node: true, + es6: true, + es2017: true, + es2020: true + }, + parserOptions: { + ecmaVersion: 2020, + sourceType: 'module', + ecmaFeatures: { + impliedStrict: true + } + }, + extends: [ + 'eslint:recommended', + // 'plugin:promise/recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:eslint-comments/recommended', + 'plugin:compat/recommended' + ], + rules: { + 'block-spacing': ["error"], + 'brace-style': ["error"], + 'comma-dangle': ["error", "never"], + 'comma-spacing': ["error"], + 'eol-last': ["error"], + 'indent': ["error", 4, { "SwitchCase": 1 }], + 'keyword-spacing': ["error"], + 'max-statements-per-line': ["error"], + 'no-floating-decimal': ["error"], + 'no-multi-spaces': ["error"], + 'no-multiple-empty-lines': ["error", { "max": 1 }], + 'no-trailing-spaces': ["error"], + 'one-var': ["error", "never"], + 'semi': ["error"], + 'space-before-blocks': ["error"] + }, + overrides: [ + { + files: [ + './src/**/*.js' + ], + env: { + node: false, + amd: true, + browser: true, + es6: true, + es2017: true, + es2020: true + }, + globals: { + // Browser globals + 'MediaMetadata': 'readonly', + // Tizen globals + 'tizen': 'readonly', + 'webapis': 'readonly', + // WebOS globals + 'webOS': 'readonly', + // Dependency globals + '$': 'readonly', + 'jQuery': 'readonly', + 'requirejs': 'readonly', + // Jellyfin globals + 'ApiClient': 'writable', + 'AppInfo': 'writable', + 'chrome': 'writable', + 'ConnectionManager': 'writable', + 'DlnaProfilePage': 'writable', + 'Dashboard': 'writable', + 'DashboardPage': 'writable', + 'Emby': 'readonly', + 'Events': 'writable', + 'getParameterByName': 'writable', + 'getWindowLocationSearch': 'writable', + 'Globalize': 'writable', + 'Hls': 'writable', + 'dfnshelper': 'writable', + 'LibraryMenu': 'writable', + 'LinkParser': 'writable', + 'LiveTvHelpers': 'writable', + 'MetadataEditor': 'writable', + 'pageClassOn': 'writable', + 'pageIdOn': 'writable', + 'PlaylistViewer': 'writable', + 'UserParentalControlPage': 'writable', + 'Windows': 'readonly' + }, + rules: { + 'block-spacing': ["error"], + 'brace-style': ["error"], + 'comma-dangle': ["error", "never"], + 'comma-spacing': ["error"], + 'eol-last': ["error"], + 'indent': ["error", 4, { "SwitchCase": 1 }], + 'keyword-spacing': ["error"], + 'max-statements-per-line': ["error"], + 'no-floating-decimal': ["error"], + 'no-multi-spaces': ["error"], + 'no-multiple-empty-lines': ["error", { "max": 1 }], + 'no-trailing-spaces': ["error"], + 'one-var': ["error", "never"], + 'semi': ["error"], + 'space-before-blocks': ["error"], + // TODO: Fix warnings and remove these rules + 'no-redeclare': ["warn"], + 'no-unused-vars': ["warn"], + 'no-useless-escape': ["warn"], + // TODO: Remove after ES6 migration is complete + 'import/no-unresolved': ["warn"] + }, + settings: { + polyfills: [ + // Native Promises Only + 'Promise', + // whatwg-fetch + 'fetch', + // document-register-element + 'document.registerElement', + // resize-observer-polyfill + 'ResizeObserver', + // fast-text-encoding + 'TextEncoder', + // intersection-observer + 'IntersectionObserver', + // Core-js + 'Object.assign', + 'Object.is', + 'Object.setPrototypeOf', + 'Object.toString', + 'Object.freeze', + 'Object.seal', + 'Object.preventExtensions', + 'Object.isFrozen', + 'Object.isSealed', + 'Object.isExtensible', + 'Object.getOwnPropertyDescriptor', + 'Object.getPrototypeOf', + 'Object.keys', + 'Object.getOwnPropertyNames', + 'Function.name', + 'Function.hasInstance', + 'Array.from', + 'Array.arrayOf', + 'Array.copyWithin', + 'Array.fill', + 'Array.find', + 'Array.findIndex', + 'Array.iterator', + 'String.fromCodePoint', + 'String.raw', + 'String.iterator', + 'String.codePointAt', + 'String.endsWith', + 'String.includes', + 'String.repeat', + 'String.startsWith', + 'String.trim', + 'String.anchor', + 'String.big', + 'String.blink', + 'String.bold', + 'String.fixed', + 'String.fontcolor', + 'String.fontsize', + 'String.italics', + 'String.link', + 'String.small', + 'String.strike', + 'String.sub', + 'String.sup', + 'RegExp', + 'Number', + 'Math', + 'Date', + 'async', + 'Symbol', + 'Map', + 'Set', + 'WeakMap', + 'WeakSet', + 'ArrayBuffer', + 'DataView', + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'Reflect' + ] + } + } + ] +} diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 0b92c0c9b..000000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,171 +0,0 @@ -env: - amd: true - browser: true - es6: true - es2017: true - es2020: true - -parserOptions: - ecmaVersion: 2020 - sourceType: module - ecmaFeatures: - impliedStrict: true - -plugins: - - promise - - import - - eslint-comments - -extends: - - eslint:recommended - - plugin:promise/recommended - - plugin:import/errors - - plugin:import/warnings - - plugin:eslint-comments/recommended - - plugin:compat/recommended - -globals: - # Browser globals - MediaMetadata: readonly - # Tizen globals - tizen: readonly - webapis: readonly - # WebOS globals - webOS: readonly - # Dependency globals - $: readonly - jQuery: readonly - requirejs: readonly - # Jellyfin globals - ApiClient: writable - AppInfo: writable - chrome: writable - ConnectionManager: writable - DlnaProfilePage: writable - Dashboard: writable - DashboardPage: writable - Emby: readonly - Events: writable - getParameterByName: writable - getWindowLocationSearch: writable - Globalize: writable - Hls: writable - dfnshelper: writable - LibraryMenu: writable - LinkParser: writable - LiveTvHelpers: writable - MetadataEditor: writable - pageClassOn: writable - pageIdOn: writable - PlaylistViewer: writable - UserParentalControlPage: writable - Windows: readonly - -rules: - block-spacing: ["error"] - brace-style: ["error"] - comma-dangle: ["error", "never"] - comma-spacing: ["error"] - eol-last: ["error"] - indent: ["error", 4, { "SwitchCase": 1 }] - keyword-spacing: ["error"] - max-statements-per-line: ["error"] - no-floating-decimal: ["error"] - no-multi-spaces: ["error"] - no-multiple-empty-lines: ["error", { "max": 1 }] - no-trailing-spaces: ["error"] - one-var: ["error", "never"] - semi: ["error"] - space-before-blocks: ["error"] - # TODO: Fix warnings and remove these rules - no-redeclare: ["warn"] - no-unused-vars: ["warn"] - no-useless-escape: ["warn"] - promise/catch-or-return: ["warn"] - promise/always-return: ["warn"] - promise/no-return-wrap: ["warn"] - # TODO: Remove after ES6 migration is complete - import/no-unresolved: ["warn"] - -settings: - polyfills: - # Native Promises Only - - Promise - # whatwg-fetch - - fetch - # document-register-element - - document.registerElement - # resize-observer-polyfill - - ResizeObserver - # fast-text-encoding - - TextEncoder - # intersection-observer - - IntersectionObserver - # Core-js - - Object.assign - - Object.is - - Object.setPrototypeOf - - Object.toString - - Object.freeze - - Object.seal - - Object.preventExtensions - - Object.isFrozen - - Object.isSealed - - Object.isExtensible - - Object.getOwnPropertyDescriptor - - Object.getPrototypeOf - - Object.keys - - Object.getOwnPropertyNames - - Function.name - - Function.hasInstance - - Array.from - - Array.arrayOf - - Array.copyWithin - - Array.fill - - Array.find - - Array.findIndex - - Array.iterator - - String.fromCodePoint - - String.raw - - String.iterator - - String.codePointAt - - String.endsWith - - String.includes - - String.repeat - - String.startsWith - - String.trim - - String.anchor - - String.big - - String.blink - - String.bold - - String.fixed - - String.fontcolor - - String.fontsize - - String.italics - - String.link - - String.small - - String.strike - - String.sub - - String.sup - - RegExp - - Number - - Math - - Date - - async - - Symbol - - Map - - Set - - WeakMap - - WeakSet - - ArrayBuffer - - DataView - - Int8Array - - Uint8Array - - Uint8ClampedArray - - Int16Array - - Uint16Array - - Int32Array - - Uint32Array - - Float32Array - - Float64Array - - Reflect From 380d66c3d7f28ef6f1c3d2127f6f7bb2ddd36364 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:07:20 +0200 Subject: [PATCH 4/9] Fix linting issues in webpack config --- webpack.dev.js | 2 +- webpack.prod.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack.dev.js b/webpack.dev.js index beca8ea4f..78bdb5486 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -28,7 +28,7 @@ module.exports = merge(common, { { test: /\.(woff|woff2|eot|ttf|otf)$/, use: [ - 'file-loader', + 'file-loader' ] } ] diff --git a/webpack.prod.js b/webpack.prod.js index 80d40f345..c2d5e9791 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -21,7 +21,7 @@ module.exports = merge(common, { { test: /\.(woff|woff2|eot|ttf|otf)$/, use: [ - 'file-loader', + 'file-loader' ] } ] From 1c5419000c91427fe1a8e6846d48179aa28f46e1 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:07:34 +0200 Subject: [PATCH 5/9] Fix linting issues in Gulgfile --- gulpfile.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 4556e71bc..0e9732455 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,3 @@ -'use strict'; - const { src, dest, series, parallel, watch } = require('gulp'); const browserSync = require('browser-sync').create(); const del = require('del'); From 519fde1abad0ce87ca71f005d6f1e98ae0e4da52 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:07:55 +0200 Subject: [PATCH 6/9] Fix linting issues in PostCSS config --- postcss.config.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/postcss.config.js b/postcss.config.js index 23159fd29..cd27a8595 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -2,10 +2,10 @@ const postcssPresetEnv = require('postcss-preset-env'); const cssnano = require('cssnano'); const config = () => ({ - plugins: [ - postcssPresetEnv(), - cssnano() - ] + plugins: [ + postcssPresetEnv(), + cssnano() + ] }); -module.exports = config +module.exports = config; From dc74e21363895bfb1b2239781032cd4caaf77530 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:08:28 +0200 Subject: [PATCH 7/9] Lint all JS files --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e79ea3c3..70e338459 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "build:development": "gulp --development", "build:production": "gulp --production", "build:standalone": "gulp standalone --development", - "lint": "eslint \"src\"", + "lint": "eslint \".\"", "stylelint": "stylelint \"src/**/*.css\"" } } From bbd1a4aa288a7f90b6fee152f3048508680255df Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 14:47:20 +0200 Subject: [PATCH 8/9] Add Autoprefixer Apprently it got the axe when moving to Gulp. Oops. --- .eslintrc.js | 17 +---------------- package.json | 2 +- postcss.config.js | 2 ++ yarn.lock | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 78aa240e6..6a01fe5bf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -94,27 +94,12 @@ module.exports = { 'Windows': 'readonly' }, rules: { - 'block-spacing': ["error"], - 'brace-style': ["error"], - 'comma-dangle': ["error", "never"], - 'comma-spacing': ["error"], - 'eol-last': ["error"], - 'indent': ["error", 4, { "SwitchCase": 1 }], - 'keyword-spacing': ["error"], - 'max-statements-per-line': ["error"], - 'no-floating-decimal': ["error"], - 'no-multi-spaces': ["error"], - 'no-multiple-empty-lines': ["error", { "max": 1 }], - 'no-trailing-spaces': ["error"], - 'one-var': ["error", "never"], - 'semi': ["error"], - 'space-before-blocks': ["error"], // TODO: Fix warnings and remove these rules 'no-redeclare': ["warn"], 'no-unused-vars': ["warn"], 'no-useless-escape': ["warn"], // TODO: Remove after ES6 migration is complete - 'import/no-unresolved': ["warn"] + 'import/no-unresolved': ["off"] }, settings: { polyfills: [ diff --git a/package.json b/package.json index 70e338459..19681c5f9 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@babel/plugin-transform-modules-amd": "^7.8.3", "@babel/polyfill": "^7.8.7", "@babel/preset-env": "^7.8.6", - "autoprefixer": "^9.7.4", + "autoprefixer": "^9.7.6", "babel-loader": "^8.0.6", "browser-sync": "^2.26.7", "clean-webpack-plugin": "^3.0.0", diff --git a/postcss.config.js b/postcss.config.js index cd27a8595..9ce2e16af 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,9 +1,11 @@ const postcssPresetEnv = require('postcss-preset-env'); +const autoprefixer = require('autoprefixer'); const cssnano = require('cssnano'); const config = () => ({ plugins: [ postcssPresetEnv(), + autoprefixer(), cssnano() ] }); diff --git a/yarn.lock b/yarn.lock index 55d6a104d..47485dd25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1553,6 +1553,19 @@ autoprefixer@^9.0.0, autoprefixer@^9.6.1, autoprefixer@^9.7.4: postcss "^7.0.27" postcss-value-parser "^4.0.3" +autoprefixer@^9.7.6: + version "9.7.6" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.6.tgz#63ac5bbc0ce7934e6997207d5bb00d68fa8293a4" + integrity sha512-F7cYpbN7uVVhACZTeeIeealwdGM6wMtfWARVLTy5xmKtgVdBNJvbDRoCK3YO1orcs7gv/KwYlb3iXwu9Ug9BkQ== + dependencies: + browserslist "^4.11.1" + caniuse-lite "^1.0.30001039" + chalk "^2.4.2" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^7.0.27" + postcss-value-parser "^4.0.3" + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -1970,6 +1983,16 @@ browserslist@^4.0.0, browserslist@^4.11.0, browserslist@^4.6.4, browserslist@^4. node-releases "^1.1.52" pkg-up "^3.1.0" +browserslist@^4.11.1: + version "4.12.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.12.0.tgz#06c6d5715a1ede6c51fc39ff67fd647f740b656d" + integrity sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg== + dependencies: + caniuse-lite "^1.0.30001043" + electron-to-chromium "^1.3.413" + node-releases "^1.1.53" + pkg-up "^2.0.0" + browserslist@^4.8.2: version "4.11.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.11.1.tgz#92f855ee88d6e050e7e7311d987992014f1a1f1b" @@ -2240,6 +2263,11 @@ caniuse-lite@^1.0.30001038: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001039.tgz#b3814a1c38ffeb23567f8323500c09526a577bbe" integrity sha512-SezbWCTT34eyFoWHgx8UWso7YtvtM7oosmFoXbCkdC6qJzRfBTeTgE9REtKtiuKXuMwWTZEvdnFNGAyVMorv8Q== +caniuse-lite@^1.0.30001039, caniuse-lite@^1.0.30001043: + version "1.0.30001046" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001046.tgz#7a06d3e8fd8aa7f4d21c9a2e313f35f2d06b013e" + integrity sha512-CsGjBRYWG6FvgbyGy+hBbaezpwiqIOLkxQPY4A4Ea49g1eNsnQuESB+n4QM0BKii1j80MyJ26Ir5ywTQkbRE4g== + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -3667,6 +3695,11 @@ electron-to-chromium@^1.3.390: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.397.tgz#db640c2e67b08d590a504c20b56904537aa2bafa" integrity sha512-zcUd1p/7yzTSdWkCTrqGvbnEOASy96d0RJL/lc5BDJoO23Z3G/VHd0yIPbguDU9n8QNUTCigLO7oEdtOb7fp2A== +electron-to-chromium@^1.3.413: + version "1.3.418" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.418.tgz#840021191f466b803a873e154113620c9f53cec6" + integrity sha512-i2QrQtHes5fK/F9QGG5XacM5WKEuR322fxTYF9e8O9Gu0mc0WmjjwGpV8c7Htso6Zf2Di18lc3SIPxmMeRFBug== + elliptic@^6.0.0: version "6.5.2" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" From 96d49d39687fe31bef6036711a3778d8aa2a1e21 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 15:02:42 +0200 Subject: [PATCH 9/9] Add more filetypes to gitattributes --- .gitattributes | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 80f9bc36e..9e495a4df 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,35 @@ -/CONTRIBUTORS.md merge=union +* text=auto + +CONTRIBUTORS.md merge=union +README.md text +LICENSE text + +*.css text +*.eot binary +*.gif binary +*.html text diff=html +*.ico binary +*.*ignore text +*.jpg binary +*.js text +*.json text +*.lock text -diff +*.map text -diff +*.md text +*.otf binary +*.png binary +*.py text diff=python +*.svg binary +*.ts text +*.ttf binary +*.sass text +*.vue text +*.webp binary +*.woff binary +*.woff2 binary + +.editorconfig text +.gitattributes export-ignore +.gitignore export-ignore + +*.gitattributes linguist-language=gitattributes