From 60b39f40d12f7b8a0d4180d6748ed464fa0ab4d6 Mon Sep 17 00:00:00 2001 From: bvolpato Date: Mon, 23 Nov 2026 23:26:54 -0500 Subject: [PATCH 1/2] Fix README links, ordering, and entry markup --- README.md | 141 ++++++++++++++++++++++++------------------------------ 1 file changed, 63 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index 5d19586..5b045ed 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,10 @@ Userscripts can improve your browsing experience, and open a lot of possibilitie - [Xbox](#-xbox) - [YouTube](#-youtube) - [Tutorials](#tutorials) -- [Community](#community) - [Additional Catalogues](#additional-catalogues) +- [Community](#community) - [Contributing](#contributing) +- [Top Contributors](#top-contributors) - [License](#license) @@ -627,19 +628,17 @@ Userscripts can be used w/ the following browsers:
- AmazonGPT - Adds AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs.
+ AmazonGPT - Adds AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs.
- +
💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
@@ -648,19 +647,17 @@ Userscripts can be used w/ the following browsers: ### Brave
- BraveGPT - Adds AI chat & search summaries to Brave Search, powered by the latest LLMs.
+ BraveGPT - Adds AI chat & search summaries to Brave Search, powered by the latest LLMs.
- +
💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
@@ -669,19 +666,17 @@ Userscripts can be used w/ the following browsers: ### ChatGPT
- AmazonGPT - Adds AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs.
+ AmazonGPT - Adds AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs.
- +
💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
@@ -703,19 +698,17 @@ Userscripts can be used w/ the following browsers:
- BraveGPT - Adds AI chat & search summaries to Brave Search, powered by the latest LLMs.
+ BraveGPT - Adds AI chat & search summaries to Brave Search, powered by the latest LLMs.
- +
💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
@@ -798,7 +791,7 @@ Userscripts can be used w/ the following browsers: ChatGPT Widescreen - Enhances ChatGPT with wide/full/tall-screen + spamblock modes. Also works on poe.com!
- +
💾 @@ -811,37 +804,33 @@ Userscripts can be used w/ the following browsers:
- DuckDuckGPT - Adds AI chat & search summaries to DuckDuckGo, powered by the latest LLMs.
+ DuckDuckGPT - Adds AI chat & search summaries to DuckDuckGo, powered by the latest LLMs.
- +
💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
- GoogleGPT - Adds AI chat & search summaries to Google Search, powered by the latest LLMs.
+ GoogleGPT - Adds AI chat & search summaries to Google Search, powered by the latest LLMs.
- +
💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
@@ -885,36 +874,36 @@ Userscripts can be used w/ the following browsers: ### Display -
- Night Mode - Adds a transparent dark layer depending on the time of the day to any website to make it less bright.
+
+ Font Rendering (Customized) - Customize font rendering on any website: font replacement, anti-aliasing, stroke, shadow, and more.
- - + +
- 💾 + 💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
-
- Font Rendering (Customized) - Customize font rendering on any website: font replacement, anti-aliasing, stroke, shadow, and more.
+
+ Night Mode - Adds a transparent dark layer depending on the time of the day to any website to make it less bright.
- - + +
- 💾 + 💾 Install / - 📖 + 📖 Readme / - 🐛 + 📢 + Discuss / + 🐛 Report bug
@@ -922,19 +911,17 @@ Userscripts can be used w/ the following browsers: ### DuckDuckGo
- DuckDuckGPT - Adds AI chat & search summaries to DuckDuckGo, powered by the latest LLMs.
+ DuckDuckGPT - Adds AI chat & search summaries to DuckDuckGo, powered by the latest LLMs.
- +
💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
@@ -1055,7 +1042,7 @@ Userscripts can be used w/ the following browsers: Classic Google Tabs - Brings back the "Maps" tab and removes the "AI Mode" tab in Google Search.
- +

This is a simple Userscript that reworks Google Search navigation tabs by removing the "AI Mode" tab, restoring the "Maps" tab, and optionally removing the "Short videos" tab.

@@ -1087,19 +1074,17 @@ Userscripts can be used w/ the following browsers:
- GoogleGPT - Adds AI chat & search summaries to Google Search, powered by the latest LLMs.
+ GoogleGPT - Adds AI chat & search summaries to Google Search, powered by the latest LLMs.
- +
- 💾 + 💾 Install / - 📖 + 📖 Readme / - 📢 - Discuss / - 🐛 + 🐛 Report bug
@@ -1388,7 +1373,7 @@ Userscripts can be used w/ the following browsers: Reddit Scroller - Auto-scrolls feeds and threads with the numpad, with an on-screen readout of speed, state and the post in focus.
- +
💾 @@ -1401,10 +1386,10 @@ Userscripts can be used w/ the following browsers:
- Reddit Tab Icons & Title Prefix - Adds subreddit icons to Reddit tabs and prefixes the tab title with the subreddit name (e.g., `r/SubredditName`) for easier tab identification and navigation.
+ Reddit Tab Icons & Title Prefix - Adds subreddit icons to Reddit tabs and prefixes the tab title with the subreddit name (e.g., r/SubredditName) for easier tab identification and navigation.
- +
💾 @@ -1424,7 +1409,7 @@ Userscripts can be used w/ the following browsers: Google Search: Stremio Links - Adds convenient "Watch on Stremio" buttons (App & Web) next to IMDb links in Google search results.
- +
💾 @@ -1442,7 +1427,7 @@ Userscripts can be used w/ the following browsers: Letterboxd Link Badges - Enhances Letterboxd film pages by replacing IMDb/TMDb text links with icons and adding direct "Watch on Stremio" badges.
- +
💾 @@ -1518,10 +1503,10 @@ Userscripts can be used w/ the following browsers: ### Xbox
-Xbox PriceLens - Add prices to Xbox game pages for every country.
+ Xbox PriceLens - Add prices to Xbox game pages for every country.
- image +
💾 @@ -1553,7 +1538,7 @@ Userscripts can be used w/ the following browsers:
- Simple Sponsor Skipper - Skips annoying intros, sponsors & filler using the SponsorBlock API. Compatible w/ YouTube, Invidious, CloudTube & Odysee.
+ Simple Sponsor Skipper - Skips annoying intros, sponsors and filler using the SponsorBlock API. Compatible w/ YouTube, Invidious, CloudTube & Odysee.
@@ -1574,10 +1559,10 @@ Userscripts can be used w/ the following browsers: YouTube A/B Loop - A lightweight userscript that adds a native A/B loop panel directly into the YouTube player.
- +
- 💾 + 💾 Install / 📖 Readme / From 1e09c8ef6f90ff22b531119656750d186ae9f7ef Mon Sep 17 00:00:00 2001 From: bvolpato Date: Mon, 23 Nov 2026 23:26:54 -0500 Subject: [PATCH 2/2] Update ESLint stack, harden CI, and add README checks --- .github/workflows/lint-on-push-pr.yml | 24 +- .github/workflows/sync-changes-to-gitlab.yml | 28 -- .../workflows/validate-links-on-push-pr.yml | 4 +- .husky/pre-commit | 4 +- .lychee.toml | 4 +- CONTRIBUTING.md | 5 +- eslint.config.mjs | 8 +- package-lock.json | 316 ++++++++++++------ package.json | 12 +- scripts/check-readme.mjs | 160 +++++++++ 10 files changed, 416 insertions(+), 149 deletions(-) delete mode 100644 .github/workflows/sync-changes-to-gitlab.yml create mode 100644 scripts/check-readme.mjs diff --git a/.github/workflows/lint-on-push-pr.yml b/.github/workflows/lint-on-push-pr.yml index 04fdbc9..11cb35b 100644 --- a/.github/workflows/lint-on-push-pr.yml +++ b/.github/workflows/lint-on-push-pr.yml @@ -1,13 +1,28 @@ name: Lint pushes/PRs -on: [push, pull_request] + +on: + push: + branches: + - master + pull_request: + branches: + - master + +permissions: + contents: read + +concurrency: + group: lint-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: lint: runs-on: ubuntu-24.04 - permissions: - contents: read + timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 @@ -16,4 +31,5 @@ jobs: npm install --global --prefix "$RUNNER_TEMP/npm-tools" npm@11.21.0 --ignore-scripts --no-audit --no-fund --before="$(node -e 'process.stdout.write(new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString())')" echo "$RUNNER_TEMP/npm-tools/bin" >> "$GITHUB_PATH" - run: npm ci --ignore-scripts - - run: npm run lint + - run: npm run lint:all + - run: npm run check:readme diff --git a/.github/workflows/sync-changes-to-gitlab.yml b/.github/workflows/sync-changes-to-gitlab.yml deleted file mode 100644 index bb936e7..0000000 --- a/.github/workflows/sync-changes-to-gitlab.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Sync changes to GitLab - -on: - push: - branches: [master] - -jobs: - build: - if: (github.repository == 'awesome-scripts/awesome-userscripts') - runs-on: ubuntu-24.04 - permissions: - contents: read - env: - TZ: PST8PDT - - steps: - - - name: Checkout awesome-scripts/awesome-userscripts - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 - - - name: Push changes to gitlab.com/awesome-scripts/awesome-userscripts - env: - GITLAB_SYNC_PAT: ${{ secrets.GITLAB_SYNC_PAT }} - run: | - git push --force -o ci.skip \ - https://oauth2:$GITLAB_SYNC_PAT@gitlab.com/awesome-scripts/awesome-userscripts.git master diff --git a/.github/workflows/validate-links-on-push-pr.yml b/.github/workflows/validate-links-on-push-pr.yml index ce610ff..c01d4c5 100644 --- a/.github/workflows/validate-links-on-push-pr.yml +++ b/.github/workflows/validate-links-on-push-pr.yml @@ -25,6 +25,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Validate links id: links @@ -40,7 +42,7 @@ jobs: - name: Wait before retry if: steps.links.outcome == 'failure' - run: sleep 15 + run: sleep 30 - name: Retry failed link check if: steps.links.outcome == 'failure' diff --git a/.husky/pre-commit b/.husky/pre-commit index 06bc854..e0c3efe 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -5,10 +5,10 @@ NC="\033[0m" # no color BR="\033[1;91m" # bright red BY="\033[1;33m" # bright yellow -# Run ESLint +# Run ESLint and README checks echo -e "\n${BY}Running ESLint...${NC}" if npm ls -g eslint &> /dev/null || npm ls eslint &> /dev/null ; then - npm run lint + npm run lint && npm run check:readme else PROJECT_ROOT=$( cd "$(dirname "$0")/.." && # nav to root diff --git a/.lychee.toml b/.lychee.toml index 373f149..8bc1596 100644 --- a/.lychee.toml +++ b/.lychee.toml @@ -1,8 +1,8 @@ cache = false timeout = 30 max_retries = 3 -retry_wait_time = 5 -max_concurrency = 8 +retry_wait_time = 10 +max_concurrency = 4 include_mail = true include_fragments = "anchor-only" index_files = ["README.md"] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 152ead4..c367ffe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,13 +61,14 @@ Use Node.js 24, matching CI: ```sh npm ci --ignore-scripts npm run lint +npm run check:readme ``` Also open every added or changed link and verify that the install link serves the intended userscript. ### Automated link checks -The required `lychee` check scans `README.md` and `CONTRIBUTING.md` on pull requests, pushes to `master`, and daily at 06:17 UTC. Each run checks links without a persistent cache and saves its report in the Actions job summary and `link-check-report` artifact. A failed scan is retried once after 15 seconds; a second failure blocks the check. Maintainers can also use **Run workflow** under **Actions > Validate links**. +The required `lychee` check scans `README.md` and `CONTRIBUTING.md` on pull requests, pushes to `master`, and daily at 06:17 UTC. Each run checks links without a persistent cache and saves its report in the Actions job summary and `link-check-report` artifact. A failed scan is retried once after 30 seconds; a second failure blocks the check. Maintainers can also use **Run workflow** under **Actions > Validate links**. To reproduce the check locally with Lychee 0.24.2: @@ -84,4 +85,4 @@ See `.lychee.toml` for timeouts and exclusions. HTTP 403 and 429 responses are t - Description is concise, factual, and ends with a period. - Install, documentation, image, and support links work. - Script was tested, with browser and userscript manager named in the pull request. -- `npm run lint` passes. +- `npm run lint` and `npm run check:readme` pass. diff --git a/eslint.config.mjs b/eslint.config.mjs index 25d0161..dbba689 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -12,15 +12,15 @@ export default [ rules: { ...js.configs.recommended.rules, ...importPlugin.flatConfigs.recommended.rules, - 'indent': 'off', 'no-unexpected-multiline': 'off', 'key-spacing': 'off', // allow whitespace anywhere + 'no-unexpected-multiline': 'off', // allow whitespace anywhere 'js-styles/no-trailing-spaces': 'error', // ...except at ends of lines 'js-styles/max-len': ['error', { 'code': 120, // limit lines to 120 chars except if containing... 'ignoreComments': true, 'ignoreStrings': true, // ...trailing/own-line comments, quoted strings... 'ignoreTemplateLiterals': true, 'ignoreRegExpLiterals': true }], // ...or template/regex literals 'js-styles/no-extra-semi': 'error', // disallow unnecessary semicolons - 'quotes': ['error', 'single', // enforce single quotes... - { 'allowTemplateLiterals': true }], // ...except backticks to avoid escaping quotes - 'comma-dangle': ['error', 'never'], // enforce no trailing commas in arrays or objects + 'js-styles/quotes': ['error', 'single', // enforce single quotes... + { 'allowTemplateLiterals': 'always' }], // ...except backticks to avoid escaping quotes + 'js-styles/comma-dangle': ['error', 'never'], // enforce no trailing commas in arrays or objects 'no-constant-condition': 'off', // allow constant conditions 'no-empty': 'off', // allow empty blocks 'no-inner-declarations': 'off', // allow function declarations anywhere diff --git a/package-lock.json b/package-lock.json index eb99dd2..31dfbad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,37 @@ "devDependencies": { "@eslint/js": "^10.0.1", "@eslint/markdown": "^8.0.3", - "@stylistic/eslint-plugin": "^5.10.0", - "eslint": "^10.9.0", - "eslint-plugin-import-x": "^4.17.1", + "@stylistic/eslint-plugin": "^6.0.1", + "eslint": "^10.15.0", + "eslint-plugin-import-x": "^4.18.1", "husky": "^9.1.7" + }, + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/@cacheable/memory": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.2.0.tgz", + "integrity": "sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/utils": "^2.5.0", + "@keyv/bigmap": "^1.3.1", + "hookified": "^1.15.1", + "keyv": "^5.6.0" + } + }, + "node_modules/@cacheable/utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.5.0.tgz", + "integrity": "sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.5.1", + "keyv": "^5.6.0" } }, "node_modules/@emnapi/core": { @@ -91,15 +118,15 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.23.5", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", - "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "version": "0.23.6", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.6.tgz", + "integrity": "sha512-WrTH7nioI9QPY4NZGnsywmecswJdgeq4BCM76qok9VgjTO29ZgUzUvcuJLVPYVQM4uDbaPBU0M33R9DIxI8X3w==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^3.0.5", "debug": "^4.3.1", - "minimatch": "^10.2.4" + "minimatch": "^11.0.5" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" @@ -189,9 +216,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", - "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz", + "integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -268,6 +295,37 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz", + "integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/@keyv/bigmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz", + "integrity": "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.4.0", + "hookified": "^1.15.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "keyv": "^5.6.0" + } + }, + "node_modules/@keyv/serialize": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==", + "dev": true, + "license": "MIT" + }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.2.tgz", @@ -291,24 +349,32 @@ } }, "node_modules/@stylistic/eslint-plugin": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.10.0.tgz", - "integrity": "sha512-nPK52ZHvot8Ju/0A4ucSX1dcPV2/1clx0kLcH5wDmrE4naKso7TUC/voUyU1O9OTKTrR6MYip6LP0ogEMQ9jPQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-6.0.1.tgz", + "integrity": "sha512-7nyi2RmGIuzBYGq5C8cFaoQsh+COfo6oHMWCygzg2iaqJJ4RDThaKCMYRkkOUAQWv80R7sbBbpuKZfulH7bFcw==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/types": "^8.56.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "estraverse": "^5.3.0", - "picomatch": "^4.0.3" + "@eslint-community/eslint-utils": "^4.10.1", + "@typescript-eslint/types": "^8.72.2", + "@typescript-eslint/visitor-keys": "^8.72.2", + "espree": "^11.2.0", + "picomatch": "^4.0.7" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "peerDependencies": { - "eslint": "^9.0.0 || ^10.0.0" + "eslint": "^9.0.0 || ^10.0.0", + "oxlint": "^1.55.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + }, + "oxlint": { + "optional": true + } } }, "node_modules/@tybys/wasm-util": { @@ -395,9 +461,9 @@ "license": "MIT" }, "node_modules/@typescript-eslint/types": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.65.0.tgz", - "integrity": "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.73.0.tgz", + "integrity": "sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw==", "dev": true, "license": "MIT", "engines": { @@ -408,6 +474,24 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.73.0.tgz", + "integrity": "sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.73.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@unrs/resolver-binding-android-arm-eabi": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.12.2.tgz", @@ -814,6 +898,20 @@ "node": "20 || >=22" } }, + "node_modules/cacheable": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.5.0.tgz", + "integrity": "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/memory": "^2.2.0", + "@cacheable/utils": "^2.5.0", + "hookified": "^1.15.0", + "keyv": "^5.6.0", + "qified": "^0.10.1" + } + }, "node_modules/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", @@ -836,6 +934,13 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/cjs-module-lexer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.3.0.tgz", + "integrity": "sha512-lmNyBzi6iYiqyrExTctfmjd8tInx+dHu9PBomTfH5RXS53c27JMFJgzNv5TyAnm3PgGf+MLy0+Ws41/HlVxdKQ==", + "dev": true, + "license": "MIT" + }, "node_modules/commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", @@ -934,6 +1039,13 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/es-module-lexer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-3.0.5.tgz", + "integrity": "sha512-RNq2lKJw53c7z9QRHeiKeA6Ez0oikOqiBGdmxQhKDxEiOX1g5QJR4IoFVwicn8uCZcRWNrXC3NZaJihgK7aEbg==", + "dev": true, + "license": "MIT" + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -948,9 +1060,9 @@ } }, "node_modules/eslint": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.9.0.tgz", - "integrity": "sha512-5KeEOJZBfEVA47boFiBsf+6MmmJpffM7qEBg4pLla2e4nlKgdKlqCW0oSLOGsT8Wl5uCGJptLV1bkaiShj90Gw==", + "version": "10.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.15.0.tgz", + "integrity": "sha512-+5Wg4p+ze3sG1WErYgUO/3H1IQIfFBymVUA0Fo/XTeBOLS6UQIUekpSJ8sdRkn7O7wjh84b55w/roqavH2aScg==", "dev": true, "license": "MIT", "workspaces": [ @@ -959,11 +1071,11 @@ "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", - "@eslint/config-array": "^0.23.5", + "@eslint/config-array": "^0.23.6", "@eslint/config-helpers": "^0.7.0", "@eslint/core": "^1.2.1", - "@eslint/plugin-kit": "^0.7.2", - "@humanfs/node": "^0.16.6", + "@eslint/plugin-kit": "^0.7.3", + "@humanfs/node": "^0.16.8", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", @@ -977,14 +1089,14 @@ "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", + "file-entry-cache": "11.1.5 || >11.1.6 <12", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "minimatch": "^10.2.5", + "minimatch": "^11.0.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, @@ -1032,18 +1144,20 @@ } }, "node_modules/eslint-plugin-import-x": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.17.1.tgz", - "integrity": "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.18.1.tgz", + "integrity": "sha512-D1h++38NS2Z40zf8jbd2OHqDrnIFRKpdp8sL0jP4xSDGZj6MNwEQua8F+r3tOWjcHrsWuhHOJ7wASWioJ31tfg==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/types": "^8.56.0", + "cjs-module-lexer": "^2.2.1", "comment-parser": "^1.4.1", "debug": "^4.4.1", + "es-module-lexer": "^3.0.3", "eslint-import-context": "^0.1.9", "is-glob": "^4.0.3", - "minimatch": "^9.0.3 || ^10.1.2", + "minimatch": "^9.0.3 || ^10.1.2 || ^11.0.1", "semver": "^7.7.2", "stable-hash-x": "^0.2.0", "unrs-resolver": "^1.9.2" @@ -1088,19 +1202,6 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", @@ -1113,7 +1214,7 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/espree": { + "node_modules/espree": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", @@ -1131,24 +1232,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/espree": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", - "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.15.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/esquery": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", @@ -1231,16 +1314,13 @@ } }, "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-11.1.5.tgz", + "integrity": "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==", "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" + "flat-cache": "^6.1.23" } }, "node_modules/find-up": { @@ -1261,17 +1341,15 @@ } }, "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "version": "6.1.23", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.23.tgz", + "integrity": "sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==", "dev": true, "license": "MIT", "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" + "cacheable": "^2.5.0", + "flatted": "^3.4.2", + "hookified": "^1.15.0" } }, "node_modules/flatted": { @@ -1323,6 +1401,26 @@ "node": ">=10.13.0" } }, + "node_modules/hashery": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/hashery/-/hashery-1.5.1.tgz", + "integrity": "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hookified": "^1.15.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/hookified": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz", + "integrity": "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==", + "dev": true, + "license": "MIT" + }, "node_modules/husky": { "version": "9.1.7", "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", @@ -1389,13 +1487,6 @@ "dev": true, "license": "ISC" }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1428,13 +1519,13 @@ } }, "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz", + "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==", "dev": true, "license": "MIT", "dependencies": { - "json-buffer": "3.0.1" + "@keyv/serialize": "^1.1.1" } }, "node_modules/levn": { @@ -2383,16 +2474,17 @@ "license": "MIT" }, "node_modules/minimatch": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", - "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "version": "11.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz", + "integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.8" + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2499,9 +2591,9 @@ } }, "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", "engines": { @@ -2531,6 +2623,26 @@ "node": ">=6" } }, + "node_modules/qified": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/qified/-/qified-0.10.1.tgz", + "integrity": "sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hookified": "^2.1.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/qified/node_modules/hookified": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-2.2.0.tgz", + "integrity": "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==", + "dev": true, + "license": "MIT" + }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", diff --git a/package.json b/package.json index 2657c3e..216d3a0 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,22 @@ { "name": "awesome-userscripts", + "engines": { + "node": ">=20.19.0" + }, "scripts": { "prepare": "husky", "lint": "eslint . --cache", "lint:all": "eslint .", "lint:fix": "eslint . --fix --cache", - "lint:fix-all": "eslint . --fix" + "lint:fix-all": "eslint . --fix", + "check:readme": "node scripts/check-readme.mjs" }, "devDependencies": { "@eslint/js": "^10.0.1", "@eslint/markdown": "^8.0.3", - "@stylistic/eslint-plugin": "^5.10.0", - "eslint": "^10.9.0", - "eslint-plugin-import-x": "^4.17.1", + "@stylistic/eslint-plugin": "^6.0.1", + "eslint": "^10.15.0", + "eslint-plugin-import-x": "^4.18.1", "husky": "^9.1.7" }, "overrides": { diff --git a/scripts/check-readme.mjs b/scripts/check-readme.mjs new file mode 100644 index 0000000..2abd37e --- /dev/null +++ b/scripts/check-readme.mjs @@ -0,0 +1,160 @@ +import console from 'node:console' +import fs from 'node:fs' +import process from 'node:process' +import { URL } from 'node:url' + +const readmePath = new URL('../README.md', import.meta.url) +const readme = fs.readFileSync(readmePath, 'utf8') +const lines = readme.split(/\r?\n/) +const errors = [] + +function addError(line, message) { + errors.push(line ? `README.md:${line}: ${message}` : `README.md: ${message}`) +} + +function slugifyHeading(rawHeading) { + const hasLeadingHtml = /^]+>/g, '').trim() + const slug = text.toLowerCase().replace(/[^a-z0-9 -]/g, '').replace(/ /g, '-') + return hasLeadingHtml ? `-${slug}` : slug +} + +// 1. Check balanced HTML tags +for (const tag of ['details', 'summary', 'blockquote', 'table', 'thead', 'tbody', 'tr', 'td', 'a']) { + const opens = (readme.match(new RegExp(`<${tag}\\b`, 'g')) || []).length + const closes = (readme.match(new RegExp(``, 'g')) || []).length + if (opens !== closes) + addError(null, `Unbalanced <${tag}> tags: ${opens} opening vs ${closes} closing.`) +} + +// 2. Check Table of Contents against actual ## / ### headings +const tocStart = lines.findIndex(line => line.trim() === '# Contents') +const tocEnd = lines.findIndex((line, idx) => idx > tocStart && /^##\s+/.test(line)) +const tocItems = [] +if (tocStart === -1 || tocEnd === -1) { + addError(null, 'Missing "# Contents" section.') +} else { + for (let i = tocStart + 1; i < tocEnd; i++) { + const match = lines[i].match(/^\s*[-*]\s+\[([^\]]+)\]\(#([^)]+)\)\s*$/) + if (match) + tocItems.push({ line: i + 1, label: match[1], anchor: match[2] }) + } +} + +const bodyHeadings = [] +for (let i = 0; i < lines.length; i++) { + const match = lines[i].match(/^(#{2,3})\s+(.+)$/) + if (!match) continue + const raw = match[2].trim() + const label = raw.replace(/<[^>]+>/g, '').trim() + bodyHeadings.push({ line: i + 1, level: match[1].length, label, anchor: slugifyHeading(raw) }) +} + +if (tocItems.length !== bodyHeadings.length) { + addError(tocStart + 1, `TOC has ${tocItems.length} items, but body has ${bodyHeadings.length} ##/### headings.`) +} else { + for (let i = 0; i < tocItems.length; i++) { + const toc = tocItems[i] + const heading = bodyHeadings[i] + if (toc.label !== heading.label || toc.anchor !== heading.anchor) + addError(toc.line, `TOC entry "[${toc.label}](#${toc.anchor})" does not match heading "${heading.label}" (#${heading.anchor}) at line ${heading.line}.`) + } +} + +// 3. Parse script categories and entries under ## Scripts +const scriptsStart = lines.findIndex(line => line.trim() === '## Scripts') +const scriptsEnd = lines.findIndex((line, idx) => idx > scriptsStart && /^##\s+/.test(line)) +const categories = [] +const entriesByCategory = new Map() +const entriesByTitle = new Map() + +let currentCategory = null +for (let i = scriptsStart + 1; i < scriptsEnd; i++) { + const line = lines[i] + if (line.startsWith('### ')) { + const name = line.slice(4).replace(/<[^>]+>/g, '').trim() + currentCategory = name + categories.push({ line: i + 1, name }) + entriesByCategory.set(name, []) + continue + } + + if (line.includes('
')) { + const startLine = i + 1 + const blockLines = [line] + while (i + 1 < scriptsEnd && !lines[i].includes('
')) { + i++ + blockLines.push(lines[i]) + } + const block = blockLines.join('\n') + const summaryMatch = block.match(/^ {4}([^<]+)<\/a>\s*-\s*(.*?)<\/summary>
$/m) + if (!summaryMatch) { + addError(startLine, 'Malformed or improperly indented line in
entry.') + continue + } + + const [, , title, description] = summaryMatch + if (!currentCategory) { + addError(startLine, `Entry "${title}" appears before any ### category heading.`) + continue + } + + if (!/[.!?]\)?$/.test(description)) + addError(startLine + 1, `Entry "${title}" description should end with terminal punctuation.`) + if (description.includes('`')) + addError(startLine + 1, `Entry "${title}" uses Markdown backticks inside HTML ; use ... instead.`) + + const urls = [...block.matchAll(/(?:href|src)="([^"]+)"/g)].map(m => m[1]) + for (const url of urls) { + if (/\s/.test(url)) + addError(startLine, `Entry "${title}" contains unescaped whitespace in URL: ${url}`) + } + + const imgs = [...block.matchAll(/]*>/g)].map(m => m[0]) + for (const img of imgs) { + if (!/\bwidth=/.test(img)) + addError(startLine, `Entry "${title}" screenshot is missing a width attribute.`) + } + + const entry = { line: startLine, category: currentCategory, title, block } + entriesByCategory.get(currentCategory).push(entry) + if (!entriesByTitle.has(title)) entriesByTitle.set(title, []) + entriesByTitle.get(title).push(entry) + } +} + +// 4. Verify alphabetical ordering of categories and entries +for (let i = 1; i < categories.length; i++) { + const prev = categories[i - 1] + const curr = categories[i] + if (prev.name.toLowerCase() > curr.name.toLowerCase()) + addError(curr.line, `Category "${curr.name}" is out of alphabetical order (after "${prev.name}").`) +} + +for (const [category, entries] of entriesByCategory) { + for (let i = 1; i < entries.length; i++) { + const prev = entries[i - 1] + const curr = entries[i] + if (prev.title.toLowerCase() > curr.title.toLowerCase()) + addError(curr.line, `Entry "${curr.title}" in "${category}" is out of alphabetical order (after "${prev.title}").`) + } +} + +// 5. Verify cross-listed entries do not drift out of sync +for (const [title, occurrences] of entriesByTitle) { + if (occurrences.length < 2) continue + const first = occurrences[0] + for (let i = 1; i < occurrences.length; i++) { + const other = occurrences[i] + if (other.block !== first.block) + addError(other.line, `Cross-listed entry "${title}" in "${other.category}" differs from "${first.category}" (line ${first.line}).`) + } +} + +if (errors.length > 0) { + for (const err of errors) + console.error(err) + process.exit(1) +} + +console.log(`README check passed (${categories.length} categories, ${entriesByTitle.size} unique scripts).`)