From d36517c02f0ca87b17baeb4fabee83cd48490f38 Mon Sep 17 00:00:00 2001 From: David Anson Date: Wed, 29 Jul 2026 13:37:29 -0700 Subject: [PATCH] Add eslint-package-json/all to lint script, address new issues. --- eslint.config.mjs | 23 ++++++++ package-lock.json | 146 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 23 ++++---- 3 files changed, 181 insertions(+), 11 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 53ca1d4..a9f60cf 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,12 +4,16 @@ import { defineConfig } from "eslint/config"; import js from "@eslint/js"; +import eslintPackageJson from "eslint-package-json"; import eslintPluginN from "eslint-plugin-n"; import eslintPluginStylistic from "@stylistic/eslint-plugin"; import eslintPluginUnicorn from "eslint-plugin-unicorn"; export default defineConfig( { + "ignores": [ + "**/package.json" + ], "plugins": { js, "n": eslintPluginN, @@ -50,5 +54,24 @@ export default defineConfig( "unicorn/prefer-module": "off", "unicorn/prefer-top-level-await": "off" } + }, + { + "files": [ + "**/package.json" + ], + "plugins": { + "package-json": eslintPackageJson + }, + "extends": [ + "package-json/all" + ], + "rules": { + "package-json/dependency-version-range": [ "error", { "range": "exact" } ], + "package-json/prefer-files-field": "off", + "package-json/require-engines": "off", + "package-json/require-entry-point": "off", + "package-json/require-private": "off", + "package-json/sort-properties": "off" + } } ); diff --git a/package-lock.json b/package-lock.json index 4d483a3..b8b6844 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@stylistic/eslint-plugin": "5.10.0", "@vercel/ncc": "0.44.1", "eslint": "10.7.0", + "eslint-package-json": "0.3.0", "eslint-plugin-n": "18.2.2", "eslint-plugin-unicorn": "72.0.0" }, @@ -177,6 +178,22 @@ } } }, + "node_modules/@eslint/json": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@eslint/json/-/json-2.0.1.tgz", + "integrity": "sha512-Thz2j92ceUF3Bq/0TuWb3MWn3Z+Cwc8k5ptF0fakl2D4Mp8mSx07Xr1aQM4R5NoihzarWUdxfOmQ8DesGy4jOg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", + "@humanwhocodes/momoa": "^3.3.10", + "natural-compare": "^1.4.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, "node_modules/@eslint/object-schema": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", @@ -253,6 +270,16 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@humanwhocodes/momoa": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-3.3.10.tgz", + "integrity": "sha512-KWiFQpSAqEIyrTXko3hFNLeQvSK8zXlJQzhhxsyVn58WFRYXST99b3Nqnu+ttOtjds2Pl2grUHGpe2NzhPynuQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, "node_modules/@humanwhocodes/retry": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", @@ -888,6 +915,31 @@ "eslint": ">=6.0.0" } }, + "node_modules/eslint-package-json": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-package-json/-/eslint-package-json-0.3.0.tgz", + "integrity": "sha512-znnM6ynvEBTTpQ/iq9hqY4OUcJ/O++wMxKpVqPu+Re/8wCsGvU0DUR/65xNI9u98ajCnn0wHkR+tAmrW2C2D3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint/json": "^2.0.1", + "detect-indent": "^7.0.2", + "hosted-git-info": "^10.1.1", + "npm-package-arg": "^14.0.0", + "semver": "^7.8.5", + "spdx-expression-parse": "^4.0.0", + "validate-npm-package-name": "^7.0.2" + }, + "engines": { + "node": ">=22" + }, + "funding": { + "url": "https://github.com/sindresorhus/eslint-package-json?sponsor=1" + }, + "peerDependencies": { + "eslint": ">=10.4" + } + }, "node_modules/eslint-plugin-es-x": { "version": "7.8.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz", @@ -1365,6 +1417,19 @@ "dev": true, "license": "ISC" }, + "node_modules/hosted-git-info": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-10.1.1.tgz", + "integrity": "sha512-DeOnSPAvOndYKfw075gt8yZzQ7S2hNztw34zBTfhIzLhmBTswIBg5/y+pqu/VD5cYWm5goAFTusDmUEmKZ0PEQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^11.1.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, "node_modules/identifier-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/identifier-regex/-/identifier-regex-1.1.0.tgz", @@ -1686,6 +1751,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lru-cache": { + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/make-asynchronous": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/make-asynchronous/-/make-asynchronous-1.1.0.tgz", @@ -2389,6 +2464,32 @@ "node": ">=18" } }, + "node_modules/npm-package-arg": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-14.0.0.tgz", + "integrity": "sha512-69XQh3k+dtGa1p+7RaR57IuG3rCko96xr/nUfN4yDYBXbTYICiWcOpsFKLN2GtGE9cyIljE+f1exnaYt9MvM+Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^10.1.0", + "proc-log": "^7.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^8.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/npm-package-arg/node_modules/validate-npm-package-name": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-8.0.0.tgz", + "integrity": "sha512-SCv6OOV6Xj2/3cXy3dGmADluJTNcL3o7hZAglNPTe+WYuEuvxgJzxPrSDLZhF+CwyQOubqgecjMmTJGMVLWjYQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -2547,6 +2648,16 @@ "node": ">= 0.8.0" } }, + "node_modules/proc-log": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-7.0.0.tgz", + "integrity": "sha512-FYgfaA69XZ93zaXLoMNQ+ViDXGGBgR8aLh03txzcFhV+9xOXx7+8DLCULrKKpR9+GsH9ZfHm82aSUPpozX0Ztg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -2738,6 +2849,31 @@ "node": ">=0.10.0" } }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.23.tgz", + "integrity": "sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/string-width": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz", @@ -2945,6 +3081,16 @@ "punycode": "^2.1.0" } }, + "node_modules/validate-npm-package-name": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-7.0.2.tgz", + "integrity": "sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, "node_modules/web-worker": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.5.0.tgz", diff --git a/package.json b/package.json index 9cedc42..bf46c51 100644 --- a/package.json +++ b/package.json @@ -2,22 +2,15 @@ "name": "markdownlint-cli2-action", "version": "24.1.0", "description": "A GitHub Action to run the markdownlint-cli2 tool for linting Markdown/CommonMark files with the markdownlint library", - "author": { - "name": "David Anson", - "url": "https://dlaa.me/" - }, + "author": "David Anson (https://dlaa.me/)", "license": "MIT", "type": "module", "homepage": "https://github.com/DavidAnson/markdownlint-cli2-action", - "repository": { - "type": "git", - "url": "git+https://github.com/DavidAnson/markdownlint-cli2-action.git" - }, - "bugs": "https://github.com/DavidAnson/markdownlint-cli2-action/issues", + "repository": "github:DavidAnson/markdownlint-cli2-action", "funding": "https://github.com/sponsors/DavidAnson", "scripts": { "build": "ncc build markdownlint-cli2-action.mjs", - "lint": "eslint *.mjs --max-warnings 0 && markdownlint-cli2 *.md", + "lint": "eslint *.mjs package.json --max-warnings 0 && markdownlint-cli2 *.md", "test": "npm run lint && npm run build && git diff --exit-code" }, "dependencies": { @@ -29,7 +22,15 @@ "@stylistic/eslint-plugin": "5.10.0", "@vercel/ncc": "0.44.1", "eslint": "10.7.0", + "eslint-package-json": "0.3.0", "eslint-plugin-n": "18.2.2", "eslint-plugin-unicorn": "72.0.0" - } + }, + "keywords": [ + "markdown", + "lint", + "md", + "commonmark", + "markdownlint" + ] }