From 2056088c9a7d52624bb68babc585097dd375b4b2 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 5 Sep 2022 00:25:34 +0300 Subject: [PATCH 01/30] Update Instagram_-_visible_images_counter.user.js Updated 'thePics' selector ( per https://greasyfork.org/en/scripts/11635-instagram-visible-images-counter/discussions/142467 ) --- .../Instagram_-_visible_images_counter.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 0d94536..817abe0 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2022.6.12 +// @version 2022.9.5 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -94,7 +94,7 @@ function createDiv() { function createObserver() { // var thePics = document.querySelector('div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'); - var thePics = document.querySelector('div[style^="flex-direction: column;"], div[style|="padding-top: 0px;"]'); // the "pics" area element, with rows that contain 3 pics each (watching for 'row' element additions) --> https://stackoverflow.com/a/5110337 ("wildcard * in CSS") starting (^=) with x and ending (|=) with y + var thePics = document.querySelector('div[style*="flex-direction: column;"], div[style$="padding-top: 0px;"]'); // the "pics" area element, with rows that contain 3 pics each (watching for 'row' element additions) --> https://stackoverflow.com/a/5110337 ("wildcard * in CSS") containing (*=) x and ending ($=) with y if (!thePics){ return; } From 4b864f1b1fe86441d9846073dd02434160aaf447 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 5 Nov 2022 18:55:17 +0200 Subject: [PATCH 02/30] Update Instagram_-_visible_images_counter.user.js Updated a selector after recent site redesign. Closes #52 . --- .../Instagram_-_visible_images_counter.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 817abe0..8537d59 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2022.9.5 +// @version 2022.11.5 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -94,7 +94,7 @@ function createDiv() { function createObserver() { // var thePics = document.querySelector('div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'); - var thePics = document.querySelector('div[style*="flex-direction: column;"], div[style$="padding-top: 0px;"]'); // the "pics" area element, with rows that contain 3 pics each (watching for 'row' element additions) --> https://stackoverflow.com/a/5110337 ("wildcard * in CSS") containing (*=) x and ending ($=) with y + var thePics = document.querySelector('div[style*="flex-direction: column;"], div[style$="padding-top: 0px;"]'); // the "pics" area element, with rows that contain 3 pics each (watching for 'row' element additions) --> https://stackoverflow.com/a/5110337 ("wildcard * in CSS") starting (^=) with x and ending ($=) with y if (!thePics){ return; } @@ -137,7 +137,8 @@ var observer; // var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts // var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element // var avatarSelector = '.eC4Dz'; // the profile's username container element -var avatarSelector = '._aa_m'; // the profile's username container element +// var avatarSelector = '._aa_m'; // the profile's username container element +var avatarSelector = '._aa_c'; // the profile's username container element // var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon // var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon From 5b708a471ac528d491245115aa6e57f08802bdb0 Mon Sep 17 00:00:00 2001 From: darkred Date: Sun, 13 Nov 2022 01:17:33 +0200 Subject: [PATCH 03/30] Update Instagram_-_visible_images_counter.user.js Fix https://github.com/darkred/Userscripts/issues/52#issuecomment-1304661340 --- .../Instagram_-_visible_images_counter.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 8537d59..f2cfa8f 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2022.11.5 +// @version 2022.11.13 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -200,7 +200,7 @@ window.addEventListener('popstate', function () { (function(){ var rs = history.pushState; history.pushState = function(state, title, url){ - if ( !url.includes('/following/') && !url.includes('/followers/') && !url.includes('/p/') && !url.includes('/direct/') ){ // avoid all possible in-page/popup "pages" (a profile's following/followers, and posts -opened by clicking on a thumb-) + if ( !url.includes('/following/') && !url.includes('/followers/') && !url.includes('/p/') && !url.includes('/direct/') && !window.location.href.includes('/p/') ){ // avoid all possible in-page/popup "pages" (a profile's following/followers, and posts -opened by clicking on a thumb-) rs.apply(history, arguments); // preserve normal functionality console.log('navigating', arguments); // do something extra here; raise an event removeCounter(); From 62c248912371a3374e92110086f8a41e58e56d18 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 30 Nov 2022 23:11:48 +0200 Subject: [PATCH 04/30] Upgrade CodeQL Action to v2 see https://github.blog/changelog/2022-04-27-code-scanning-deprecation-of-codeql-action-v1/ --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b9d2149..939bfc3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -55,7 +55,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -69,4 +69,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 3d4e355469b7704a5818811d79c5479601e1053c Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 30 Nov 2022 23:26:08 +0200 Subject: [PATCH 05/30] Keeping your actions up to date with Dependabot see https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 000d73e..14ffbea 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,8 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" From bc5279b3b6512f84b31d0207cea4a65f9508f621 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 30 Nov 2022 23:37:27 +0200 Subject: [PATCH 06/30] Update dependabot.yml --- .github/dependabot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 14ffbea..75d11ec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,8 +9,8 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + - package-ecosystem: "github-actions" directory: "/" schedule: - # Check for updates to GitHub Actions every week - interval: "weekly" + interval: "weekly" # Check for updates to GitHub Actions every week From f5a0c93c2620e8e649caf89856adb0656c226ee2 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 30 Nov 2022 23:39:11 +0200 Subject: [PATCH 07/30] Update codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 939bfc3..3b24495 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From c62558486d722326866e34a47635c2241aec6924 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Nov 2022 21:42:32 +0000 Subject: [PATCH 08/30] Bump actions/dependency-review-action from 1 to 3 Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 1 to 3. - [Release notes](https://github.com/actions/dependency-review-action/releases) - [Commits](https://github.com/actions/dependency-review-action/compare/v1...v3) --- updated-dependencies: - dependency-name: actions/dependency-review-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index f2605b7..da99d0c 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -11,4 +11,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v3 - name: 'Dependency Review' - uses: actions/dependency-review-action@v1 + uses: actions/dependency-review-action@v3 From 67f4d1a0ec19573c70d807f782a4b89e43f54a38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 17:08:29 +0000 Subject: [PATCH 09/30] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 45705e4..7102066 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install modules run: npm install - name: Run ESLint From 8fbfa85ce54a42dd89e3b18551b005d10d2bcee6 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 20 Mar 2023 16:07:23 +0200 Subject: [PATCH 10/30] Added 3 eslint plugins `eslint-plugin-css`, `eslint-plugin-es-x`, `eslint-plugin-yml` --- .eslintrc.js | 4 ++++ package.json | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index fcea33a..1b84299 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,5 @@ +/* eslint-disable quotes */ + module.exports = { "env": { "browser": true, @@ -11,6 +13,7 @@ module.exports = { "extends": [ "eslint:recommended", // "eslint:all", + "plugin:jsonc/recommended-with-json", // "plugin:no-jquery/recommended", "plugin:no-jquery/deprecated", // "plugin:no-jquery/slim", @@ -49,6 +52,7 @@ module.exports = { "new-cap": "off", "no-alert": "warn", "no-console": "warn", + "no-dupe-keys": "warn", "no-extra-semi": "warn", "no-inline-comments": "off", "no-magic-numbers": "off", diff --git a/package.json b/package.json index 95e2497..d678f81 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,12 @@ { "devDependencies": { "eslint": "*", + "eslint-plugin-css": "*", + "eslint-plugin-es-x": "*", "eslint-plugin-jsonc": "*", "eslint-plugin-no-jquery": "*", "eslint-plugin-regexp": "*", - "eslint-plugin-userscripts": "*" + "eslint-plugin-userscripts": "*", + "eslint-plugin-yml": "*" } } From f867089732cd5001e61654304e4637324bafb7d7 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 20 Mar 2023 23:38:45 +0200 Subject: [PATCH 11/30] Update .eslintrc.js --- .eslintrc.js | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1b84299..8ebc3c0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,8 @@ /* eslint-disable quotes */ module.exports = { + "root": true, + "env": { "browser": true, "es6": true, @@ -8,11 +10,24 @@ module.exports = { "jquery": true, // "node": true }, + + "parserOptions": { + // "ecmaVersion": 12, + "ecmaVersion": "latest", + "sourceType": "script", + "ecmaFeatures": { + "globalReturn ": true, + "impliedStrict": true, + // "jsx": true, + }, + }, + // "extends": "eslint:all", // "extends": "eslint:recommended", "extends": [ "eslint:recommended", // "eslint:all", + "plugin:css/recommended", "plugin:jsonc/recommended-with-json", // "plugin:no-jquery/recommended", "plugin:no-jquery/deprecated", @@ -21,23 +36,16 @@ module.exports = { // "plugin:clean-regex/recommended" "plugin:regexp/recommended", // "plugin:regexp/all", - ], + "plugins": [ + "css", + "jsonc", // "clean-regex", - "regexp", "no-jquery", + "regexp", ], - "parserOptions": { - // "ecmaVersion": 12, - "ecmaVersion": 'latest', - "sourceType": "script", - "ecmaFeatures": { - "globalReturn ": true, - "impliedStrict": true, - // "jsx": true, - }, - }, + "rules": { "complexity": ["warn", 20], "eqeqeq": "warn", @@ -73,8 +81,8 @@ module.exports = { "space-before-function-paren": "off", // "space-in-parens": ["warn", "always"], "unicode-bom": ["warn", "never"], - }, + "reportUnusedDisableDirectives": true }; From b493348a37b9bd93792c5acd9d142855b737cd44 Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 31 Mar 2023 21:30:17 +0300 Subject: [PATCH 12/30] Update Instagram_-_visible_images_counter.user.js Updated a selector after recent changes in Instagram HTML --- .../Instagram_-_visible_images_counter.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index f2cfa8f..2a79c03 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2022.11.13 +// @version 2023.3.31 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -55,7 +55,8 @@ function showCounter() { // hrefselems = document.querySelectorAll(`a[href*='taken-by']`); - hrefselems = document.querySelectorAll(`._aabd._aa8k._aanf > a`); + // hrefselems = document.querySelectorAll(`._aabd._aa8k._aanf > a`); + hrefselems = document.querySelectorAll(`._aabd._aa8k._al3l > a`); $.each(hrefselems, function(index, value) { // hrefs.indexOf(String(value)) === -1 ? hrefs.push(String(value)) : console.log("This item already exists"); // https://stackoverflow.com/a/36683363 if (hrefs.indexOf(String(value)) === -1) { // hrefs.count -below- serves as a counter for the newly added displayed images (on each infinite scrolling event) From 995a514ca5697805f7b92d3035527f2839b7567d Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 1 Jun 2023 23:00:25 +0300 Subject: [PATCH 13/30] Update ProtonMail_-_remove_forced_signature.user.js Updated for the recent html changes. Per https://greasyfork.org/en/scripts/368881-protonmail-remove-forced-signature/discussions/185640 --- ...otonMail_-_remove_forced_signature.user.js | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js b/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js index 8f7306f..b50669c 100644 --- a/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js +++ b/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name ProtonMail - remove forced signature // @namespace darkred -// @version 2022.7.11 +// @version 2023.6.1 // @description Removes the forced ProtonMail signature from the 'New message' textboxes // @author darkred // @license MIT @@ -27,34 +27,45 @@ document.arrive(elementToWatch, function () { const callback = function(mutationList, observer) { mutationList.forEach( (mutation) => { mutation.addedNodes.forEach( (node) => { - if (node.className === 'protonmail_signature_block') { + + const refNode = 'protonmail_signature_block'; + + if (node.className === refNode) { // DOM STRUCTURE: // - // The 2 previous element siblings of the main signature element, '.protonmail_signature_block', are both
elements with
: - //
|
| .protonmail_signature_block + // The 2 previous element siblings of the main signature element, '.protonmail_signature_block', both contain a
element with a
inside, i.e.
=
\
) : + //
\
|
\
| .protonmail_signature_block + // + // The '.protonmail_signature_block' itself has either 3 or 2
children which can be: + // + // (when user signature doesn't exist) the (empty) user signature , and the proton signature + // .protonmail_signature_block-user.protonmail_signature_block-empty | .protonmail_signature_block-proton // - // The '.protonmail_signature_block' itself has 3
children which can be: - // (when user signature doesn't exist) 2 with
, and the proton signature - //
|
| .protonmail_signature_block-proton - // (when user signature exists) the user signature (.protonmail_signature_block-user) , 1 with
, and the signature itself - // .protonmail_signature_block-user |
| .protonmail_signature_block-proton + // (when user signature exists) the user signature , 1
\
, and the signature itself + // .protonmail_signature_block-user |
\
| .protonmail_signature_block-proton // // The script's functionality is: - // 1. if a user signature exists, to also remove the 2
elements before the main '.protonmail_signature_block' element. - // 2. Regardless of whether a user signature exists or not, to remove the last element ('.protonmail_signature_block-proton') and the
before it. + // 1. Regardless of whether a user signature exists or not, to remove the 2
\
elements before the main/reference '.protonmail_signature_block' element. + // 2a. to remove the last element ('.protonmail_signature_block-proton') + // 2b. + if a user signature is not empty, to also remove the
\
before it. + // + // See DOM screenshots: https://imgur.com/a/VEI4nDQ + - const signatureUser = '.protonmail_signature_block-user'; const signatureProton = '.protonmail_signature_block-proton'; - if (node.querySelector(signatureUser).firstElementChild.textContent === '' ) { + + if (!node.firstElementChild.classList.contains('protonmail_signature_block-empty')){ + node.querySelector(signatureProton).previousElementSibling.remove(); + } else { node.previousElementSibling.remove(); node.previousElementSibling.remove(); } - node.querySelector(signatureProton).previousElementSibling.remove(); node.querySelector(signatureProton).remove(); + observer.disconnect(); } }); From fc8891996c38b4cdc1afef26b70f69c8fb4426a2 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 1 Jun 2023 23:12:03 +0300 Subject: [PATCH 14/30] Update ProtonMail_-_remove_forced_signature.user.js --- .../ProtonMail_-_remove_forced_signature.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js b/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js index b50669c..0e79958 100644 --- a/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js +++ b/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js @@ -46,9 +46,9 @@ document.arrive(elementToWatch, function () { // .protonmail_signature_block-user |
\
| .protonmail_signature_block-proton // // The script's functionality is: - // 1. Regardless of whether a user signature exists or not, to remove the 2
\
elements before the main/reference '.protonmail_signature_block' element. - // 2a. to remove the last element ('.protonmail_signature_block-proton') - // 2b. + if a user signature is not empty, to also remove the
\
before it. + // 1a. If user signature exists(=it's not empty), to remove the
\
element before the last element ('.protonmail_signature_block-proton') ... + // 1b. ... otherwise to remove the 2
\
elements before the main/reference '.protonmail_signature_block' element. + // 2. To remove the last element ('.protonmail_signature_block-proton') itself. // // See DOM screenshots: https://imgur.com/a/VEI4nDQ From e8253c1f6001142fbf13da1bf4439ef5e41442e5 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 3 Jun 2023 00:26:50 +0300 Subject: [PATCH 15/30] Update Rotten_Tomatoes_Decimal_Rating.user.js Update for the recent RT html changes --- .../Rotten_Tomatoes_Decimal_Rating.user.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Rotten_Tomatoes_Decimal_Rating/Rotten_Tomatoes_Decimal_Rating.user.js b/Rotten_Tomatoes_Decimal_Rating/Rotten_Tomatoes_Decimal_Rating.user.js index 78eb5dc..160b787 100644 --- a/Rotten_Tomatoes_Decimal_Rating/Rotten_Tomatoes_Decimal_Rating.user.js +++ b/Rotten_Tomatoes_Decimal_Rating/Rotten_Tomatoes_Decimal_Rating.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name Rotten Tomatoes Decimal Rating // @namespace darkred -// @version 6.0.3 -// @date 2022.5.15 +// @version 7 +// @date 2023.6.3 // @description Changes base-5 Rating of Rotten Tomatoes to base-10 // @author wOxxOm, darkred // @license MIT @@ -76,8 +76,8 @@ scoreBoard.onclick = function(event) { audienceScorex2(); - let buttonVerifiedAudience = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > filter-chip:nth-child(2)'); - let buttonAllAudience = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > filter-chip:nth-child(3)'); + let buttonVerifiedAudience = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > filter-chip:nth-child(2)'); + let buttonAllAudience = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > filter-chip:nth-child(3)'); [ buttonVerifiedAudience, buttonAllAudience ].forEach(function(element) { if (element) { element.addEventListener('click', function() { @@ -89,13 +89,13 @@ scoreBoard.onclick = function(event) { // the '?' buttons for the two descriptive texts - let buttonQuestionmarkTomatometer = document.querySelector('#mainColumn > overlay-base > score-details > score-details-critics > tool-tip'); - let buttonQuestionmarkAudienceScore = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > tool-tip'); + let buttonQuestionmarkTomatometer = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-critics > tool-tip'); + let buttonQuestionmarkAudienceScore = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > tool-tip'); buttonQuestionmarkTomatometer.addEventListener('click', function(){ - let descriptiveTextTomatometer = document.querySelector('#mainColumn > overlay-base > score-details > score-details-critics > tool-tip').shadowRoot.querySelector('.description'); + let descriptiveTextTomatometer = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-critics > tool-tip').shadowRoot.querySelector('.description'); if (!descriptiveTextTomatometer.textContent.includes('review (6 stars or higher)')) { descriptiveTextTomatometer.innerHTML = descriptiveTextTomatometer.innerHTML.replace('review', 'review (6 stars or higher)'); } @@ -106,7 +106,7 @@ scoreBoard.onclick = function(event) { buttonQuestionmarkAudienceScore.addEventListener('click', function(){ // There are now two occurrences of '3.5 stars or higher' in the AUDIENCE descriptive text overlay, hence the querySelectorAll() - let descriptiveTextAudienceScode = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > tool-tip').shadowRoot.querySelectorAll('.description'); + let descriptiveTextAudienceScode = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > tool-tip').shadowRoot.querySelectorAll('.description'); /* descriptiveTextAudienceScode.innerHTML = descriptiveTextAudienceScode.innerHTML.replace(/([\d.]+)( stars)/g, function (m, s1, s2) { return 2 * s1 + s2; From 32bf7f5abb020bddae46a6f0d1e0dd6ce85eff14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:47:12 +0000 Subject: [PATCH 16/30] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/dependency-review.yml | 2 +- .github/workflows/lint.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3b24495..f3a1df8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index da99d0c..b994508 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -9,6 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Dependency Review' uses: actions/dependency-review-action@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7102066..f2415f5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install modules run: npm install - name: Run ESLint From 93989db01de736e6973d77a783ce8842347fde48 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 27 Sep 2023 00:32:46 +0300 Subject: [PATCH 17/30] Update Instagram_-_visible_images_counter.user.js Fix https://github.com/darkred/Userscripts/issues/52#issuecomment-1736307112 --- ...Instagram_-_visible_images_counter.user.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 2a79c03..d254beb 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2023.3.31 +// @version 2023.9.27 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -132,16 +132,17 @@ var div = document.createElement('div'); var observer; // var avatarSelector = 'span[style="width: 152px; height: 152px;"]'; // the profile's photo/avatar element +// var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon +// var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon // var avatarSelector = '._mainc'; // the profile's bio area element // var avatarSelector = 'h1.notranslate'; // the profile name element -// var avatarSelector = 'h1.rhpdm'; // the profile name element -// var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts -// var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element -// var avatarSelector = '.eC4Dz'; // the profile's username container element -// var avatarSelector = '._aa_m'; // the profile's username container element -var avatarSelector = '._aa_c'; // the profile's username container element -// var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon -// var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon +// var avatarSelector = 'h1.rhpdm'; // the profile name element +// var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts +// var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element +// var avatarSelector = '.eC4Dz'; // the profile's username container element +// var avatarSelector = '._aa_m'; // the profile's username container element +// var avatarSelector = '._aa_c'; // the profile's username container element +var avatarSelector = '.x1q0g3np.x2lah0s.x8j4wrb'; // the profile's username container element From 4da58ca1a6c53d53c5a3434d8d104485e3a28861 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:29:02 +0000 Subject: [PATCH 18/30] Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f3a1df8..3e97f43 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -55,7 +55,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -69,4 +69,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 99f5e6c5da85a2eef300c0486917de8ef5a7e177 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:10:30 +0000 Subject: [PATCH 19/30] Bump actions/dependency-review-action from 3 to 4 Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3 to 4. - [Release notes](https://github.com/actions/dependency-review-action/releases) - [Commits](https://github.com/actions/dependency-review-action/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/dependency-review-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index b994508..b9d6d20 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -11,4 +11,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v4 - name: 'Dependency Review' - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 From 5e7b16230b3a40f36ba6d0a5c83de5f286e325e2 Mon Sep 17 00:00:00 2001 From: darkred Date: Sun, 28 Jan 2024 22:38:19 +0200 Subject: [PATCH 20/30] Create evergreen.yml This is a GitHub Action that given an organization or specified repositories, opens an issue/PR dependabot is not enabled but could be. It also enables automated security updates for the repository. --- .github/workflows/evergreen.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/evergreen.yml diff --git a/.github/workflows/evergreen.yml b/.github/workflows/evergreen.yml new file mode 100644 index 0000000..57eb768 --- /dev/null +++ b/.github/workflows/evergreen.yml @@ -0,0 +1,22 @@ +name: Weekly dependabot checks + +on: + workflow_dispatch: + schedule: + - cron: '3 2 1 * *' + +permissions: + issues: write + pull-requests: write + +jobs: + evergreen: + name: evergreen + runs-on: ubuntu-latest + + steps: + - name: Run evergreen action + uses: github/evergreen@v1 + env: + GH_TOKEN: ${{ secrets.EVERGREEN_ACTION }} + REPOSITORY: darkred From dce253efbb27609a4481957438a593bbffa9d1dd Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 23 Feb 2024 15:29:28 +0200 Subject: [PATCH 21/30] Update Instagram_-_visible_images_counter.user.js Updated 'hrefselems' selector. --- .../Instagram_-_visible_images_counter.user.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index d254beb..3c5be12 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2023.9.27 +// @version 2024.2.23 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -56,7 +56,8 @@ function showCounter() { // hrefselems = document.querySelectorAll(`a[href*='taken-by']`); // hrefselems = document.querySelectorAll(`._aabd._aa8k._aanf > a`); - hrefselems = document.querySelectorAll(`._aabd._aa8k._al3l > a`); + // hrefselems = document.querySelectorAll(`._aabd._aa8k._al3l > a`); + hrefselems = document.querySelectorAll(`._aabd._aa8k.x2pgyrj > a`); $.each(hrefselems, function(index, value) { // hrefs.indexOf(String(value)) === -1 ? hrefs.push(String(value)) : console.log("This item already exists"); // https://stackoverflow.com/a/36683363 if (hrefs.indexOf(String(value)) === -1) { // hrefs.count -below- serves as a counter for the newly added displayed images (on each infinite scrolling event) @@ -139,10 +140,12 @@ var observer; // var avatarSelector = 'h1.rhpdm'; // the profile name element // var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts // var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element -// var avatarSelector = '.eC4Dz'; // the profile's username container element -// var avatarSelector = '._aa_m'; // the profile's username container element -// var avatarSelector = '._aa_c'; // the profile's username container element -var avatarSelector = '.x1q0g3np.x2lah0s.x8j4wrb'; // the profile's username container element +// var avatarSelector = '.eC4Dz'; // the profile's username container element +// var avatarSelector = '._aa_m'; // the profile's username container element +// var avatarSelector = '._aa_c'; // the profile's username container element +// var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon +// var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon +var avatarSelector = '.x1q0g3np.x2lah0s.x8j4wrb'; // the 3-dots icon From 23aa3269f3c1c378c59af3578685d94cdca80756 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:15:58 +0000 Subject: [PATCH 22/30] Add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..5db72dd --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +} From 66d93196086e6d0767f88ef29eb36815498855db Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 13 Dec 2024 02:17:01 +0200 Subject: [PATCH 23/30] Update .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index bdb0cab..1e78b8c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Auto detect text files and perform LF normalization -* text=auto +* text=auto eol=lf # Custom for Visual Studio *.cs diff=csharp From b19bbd8c3c3bff313d3ef9414c578c5028ee1c52 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 17:55:01 +0200 Subject: [PATCH 24/30] Delete codeql-analysis.yml [CodeQL code scanning] Drop advanced setup (codeql-analysis.yml) in favor of default setup --- .github/workflows/codeql-analysis.yml | 72 --------------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 3e97f43..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '23 10 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - queries: +security-and-quality - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 From 313dc43be9a4241dc7a6b5d07647ec0d5fd72048 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 22:07:46 +0200 Subject: [PATCH 25/30] Drop .eslintignore Drop .eslintignore in favor of using the "ignores" property in "eslint.config.js" (flat config format)(flat config format) --- .eslintignore => .eslintignore [DEPRECATED] | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .eslintignore => .eslintignore [DEPRECATED] (100%) diff --git a/.eslintignore b/.eslintignore [DEPRECATED] similarity index 100% rename from .eslintignore rename to .eslintignore [DEPRECATED] From e3e80600506be714f8362642f45edc065869d6ff Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 22:08:45 +0200 Subject: [PATCH 26/30] Migrate to flat config format --- .eslintrc.json [DEPRECATED] | 61 ++++++++++ eslint.config.js | 208 +++++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) create mode 100644 .eslintrc.json [DEPRECATED] create mode 100644 eslint.config.js diff --git a/.eslintrc.json [DEPRECATED] b/.eslintrc.json [DEPRECATED] new file mode 100644 index 0000000..a34a4d6 --- /dev/null +++ b/.eslintrc.json [DEPRECATED] @@ -0,0 +1,61 @@ +{ + "root": true, + "env": { + "browser": true, + "es6": true, + "greasemonkey": true, + "jquery": true + }, + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "script", + "ecmaFeatures": { + "globalReturn ": true, + "impliedStrict": true + } + }, + "extends": [ + "eslint:recommended", + "plugin:css/recommended", + "plugin:jsonc/recommended-with-json", + "plugin:no-jquery/deprecated", + "plugin:regexp/recommended" + ], + "plugins": [ + "css", + "jsonc", + "no-jquery", + "regexp" + ], + "rules": { + "complexity": ["warn", 20], + "eqeqeq": "warn", + "func-style": "off", + "indent": ["warn","tab", { "ignoreComments": false, "SwitchCase": 1 } ], + "linebreak-style": ["warn","unix"], + "max-len": "off", + "max-statements-per-line": "off", + "new-cap": "off", + "no-alert": "warn", + "no-console": "warn", + "no-dupe-keys": "warn", + "no-extra-semi": "warn", + "no-inline-comments": "off", + "no-magic-numbers": "off", + "no-misleading-character-class": "warn", + "no-mixed-spaces-and-tabs": "warn", + "no-multiple-empty-lines": "off", + "no-tabs": "off", + "no-unused-labels": "warn", + "no-unused-vars": ["warn", {"vars": "all", "args": "after-used"}], + "no-useless-escape": "warn", + "padded-blocks": "off", + "quotes": ["warn", "single", { "allowTemplateLiterals": true }] , + "require-jsdoc": "off", + "require-unicode-regexp": "off", + "semi": ["warn","always"], + "space-before-function-paren": "off", + "unicode-bom": ["warn", "never"] + }, + "reportUnusedDisableDirectives": true +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..d7f634b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,208 @@ +/* eslint-disable @stylistic/js/quotes */ +/* eslint-disable @stylistic/js/indent */ + +// import * as cssPlugin from "eslint-plugin-css"; +import css from "@eslint/css"; +import eslintPluginJsonc from 'eslint-plugin-jsonc'; +import json from "@eslint/json"; +import noJquery from "eslint-plugin-no-jquery"; +import * as regexpPlugin from "eslint-plugin-regexp"; +import markdown from "@eslint/markdown"; +import globals from "globals"; +import js from "@eslint/js"; +import stylisticJs from "@stylistic/eslint-plugin-js"; + + +export default [ + { + files: ['**/*.js', '**/*.mjs'], + ...js.configs.recommended + }, + // cssPlugin.configs["flat/recommended"], + ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'], + { + files: ['**/*.js', '**/*.mjs'], + ...regexpPlugin.configs["flat/recommended"], + }, + ...markdown.configs.recommended, + { + files: ["**/*.js"], + ignores: ["**/*.min.js"], + + plugins: { + "@stylistic/js": stylisticJs + }, + + linterOptions: { + reportUnusedDisableDirectives: true, + }, + + languageOptions: { + globals: { + ...globals.browser, + ...globals.greasemonkey, + ...globals.jquery, + }, + + ecmaVersion: "latest", + sourceType: "module", + + + parserOptions: { + ecmaFeatures: { + "globalReturn ": true, + impliedStrict: true, + }, + }, + }, + + rules: { + complexity: ["warn", 20], + eqeqeq: "warn", + "func-style": "off", + + "@stylistic/js/indent": ["warn", "tab", { + ignoreComments: false, + SwitchCase: 1, + }], + + "@stylistic/js/linebreak-style": ["warn", "unix"], + "@stylistic/js/max-len": "off", + "@stylistic/js/max-statements-per-line": "off", + "new-cap": "off", + "no-alert": "warn", + "no-console": "warn", + "no-dupe-keys": "warn", + "@stylistic/js/no-extra-semi": "warn", + "no-inline-comments": "off", + "no-magic-numbers": "off", + "no-misleading-character-class": "warn", + "@stylistic/js/no-mixed-spaces-and-tabs": "warn", + "@stylistic/js/no-multiple-empty-lines": "off", + "@stylistic/js/no-tabs": "off", + "no-unused-labels": "warn", + + "no-unused-vars": ["warn", { + vars: "all", + args: "after-used", + }], + + "no-useless-escape": "warn", + "@stylistic/js/padded-blocks": "off", + + "@stylistic/js/quotes": ["warn", "single", { + allowTemplateLiterals: true, + }], + + "require-jsdoc": "off", + "require-unicode-regexp": "off", + "@stylistic/js/semi": ["warn", "always"], + "@stylistic/js/space-before-function-paren": "off", + "unicode-bom": ["warn", "never"], + }, + + }, + + + // https://github.com/eslint/json#usage + { + plugins: { + json, + }, + }, + // lint JSON files // (from: https://github.com/eslint/json#recommended-configuration) + { + files: ["**/*.json"], + language: "json/json", + ...json.configs.recommended, + }, + + // lint JSON-C files + { + // files: ["**/*.jsonc"], + files: ["**/*.jsonc", ".vscode/*.json"], // https://github.com/eslint/json/pull/11 + language: "json/jsonc", + ...json.configs.recommended, + }, + + + + // https://github.com/eslint/markdown#configuring + { + // 1. Add the plugin + plugins: { + markdown + } + }, + + // https://www.npmjs.com/package/eslint-plugin-markdown + // https://eslint.org/docs/latest/use/configure/plugins + // https://github.com/eslint/json + { + // 2. Enable the Markdown processor for all .md files. + files: ["**/*.md"], + // files: ["**/*.md/*.js"], + // plugins: { + // markdown + // }, + processor: "markdown/markdown" + }, + { + // // 3. Optionally, customize the configuration ESLint uses for ```js + // // fenced code blocks inside .md files. + files: ["**/*.md/*.js"], + rules: { + // ... + + // 2. Disable other rules. + // "no-console": "off", + // "import/no-unresolved": "off" + } + }, + + + + + + + + + // https://eslint.org/blog/2025/02/eslint-css-support/ [NEW ADDITION 20/2/2025] + // + // lint css files + { + files: ["**/*.css"], + plugins: { + css, + }, + language: "css/css", + rules: { + "css/no-duplicate-imports": "error", + }, + }, + + + + + // https://eslint.org/docs/latest/use/configure/ignore + // https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files + { + // Note: there should be no other properties in this object + ignores: [ + + "node_modules/*", + "**/*.min.js", + "package-lock.json" + + ] + + } + + + + + + + + +]; \ No newline at end of file From 7af1130058bfe5a997276da477226845c313c4d6 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 23:43:11 +0200 Subject: [PATCH 27/30] Update eslint.config.js --- eslint.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint.config.js b/eslint.config.js index d7f634b..5b0a1aa 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -45,7 +45,8 @@ export default [ }, ecmaVersion: "latest", - sourceType: "module", + // sourceType: "module", + sourceType: "script", parserOptions: { From 8dbf3b1b942c44a12d0627ee81395438d1dbe1fe Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 23:45:10 +0200 Subject: [PATCH 28/30] Revert "Update eslint.config.js" This reverts commit 7af1130058bfe5a997276da477226845c313c4d6. --- eslint.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 5b0a1aa..d7f634b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -45,8 +45,7 @@ export default [ }, ecmaVersion: "latest", - // sourceType: "module", - sourceType: "script", + sourceType: "module", parserOptions: { From b7fda557e6ab3ab3ef203cfea3e74b6a58a81b1c Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 7 Mar 2025 00:29:38 +0200 Subject: [PATCH 29/30] Update package.json --- package.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d678f81..36eeb6d 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,29 @@ { + "type": "module", "devDependencies": { - "eslint": "*", + "@biomejs/biome": "*", + "@eslint/config-inspector": "*", + "@eslint/css": "*", + "@eslint/eslintrc": "*", + "@eslint/js": "*", + "@eslint/json": "*", + "@eslint/markdown": "*", + "@eslint/migrate-config": "*", + "@stylistic/eslint-plugin": "*", + "@stylistic/eslint-plugin-js": "*", + "eslint": "^9.10.0", "eslint-plugin-css": "*", "eslint-plugin-es-x": "*", + "eslint-plugin-jsdoc": "*", "eslint-plugin-jsonc": "*", "eslint-plugin-no-jquery": "*", "eslint-plugin-regexp": "*", "eslint-plugin-userscripts": "*", - "eslint-plugin-yml": "*" + "eslint-plugin-yml": "*", + "globals": "*" + }, + "dependencies": { + "rescript": "*", + "turbo": "*" } } From 5137627e96d6e06cb0d13cc6ebdc5f4f9917cb0a Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 7 Mar 2025 00:34:49 +0200 Subject: [PATCH 30/30] Drop .eslintrc.js --- .eslintrc.js => .eslintrc.js [DEPRECATED] | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .eslintrc.js => .eslintrc.js [DEPRECATED] (100%) diff --git a/.eslintrc.js b/.eslintrc.js [DEPRECATED] similarity index 100% rename from .eslintrc.js rename to .eslintrc.js [DEPRECATED]