diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a2b374da6..095ace250 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -107,6 +107,12 @@ module.exports = { "jsonc/no-comments": "off", }, }, + { + extends: ["plugin:package-json/recommended"], + files: ["package.json"], + parser: "jsonc-eslint-parser", + plugins: ["package-json"], + }, { files: "**/*.test.ts", rules: { diff --git a/.github/DEVELOPMENT.md b/.github/DEVELOPMENT.md index d0d240164..a7f6dc671 100644 --- a/.github/DEVELOPMENT.md +++ b/.github/DEVELOPMENT.md @@ -47,7 +47,6 @@ Each should be shown in VS Code, and can be run manually on the command-line: - `pnpm lint` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files - `pnpm lint:knip` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports - `pnpm lint:md` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files -- `pnpm lint:package-json` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the `package.json` file - `pnpm lint:packages` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the `pnpm-lock.yml` file - `pnpm lint:spelling` ([cspell](https://cspell.org)): Spell checks across all source files diff --git a/.github/workflows/lint-package-json.yml b/.github/workflows/lint-package-json.yml deleted file mode 100644 index d5a8cd395..000000000 --- a/.github/workflows/lint-package-json.yml +++ /dev/null @@ -1,15 +0,0 @@ -jobs: - lint_package_json: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/prepare - - run: pnpm lint:package-json - -name: Lint Package JSON - -on: - pull_request: ~ - push: - branches: - - main diff --git a/.npmpackagejsonlintrc.json b/.npmpackagejsonlintrc.json deleted file mode 100644 index 60d8a2054..000000000 --- a/.npmpackagejsonlintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "npm-package-json-lint-config-default", - "rules": { "require-description": "error", "require-license": "error" } -} diff --git a/docs/Options.md b/docs/Options.md index 28793ebdd..9749581f3 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -88,7 +88,7 @@ Alternately, you can bypass that prompt by providing any number of the following - `--exclude-lint-json`: Don't apply linting and sorting to `*.json` and `*.jsonc` files. - `--exclude-lint-knip`: Don't add Knip to detect unused files, dependencies, and code exports. - `--exclude-lint-md`: Don't apply linting to `*.md` files. -- `--exclude-lint-package-json`: Don't add npm-package-json-lint to lint for package.json correctness. +- `--exclude-lint-package-json`: Don't add eslint-plugin-package-json to lint for package.json correctness. - `--exclude-lint-deprecation`: Don't use eslint-plugin-deprecation to report on usage of code marked as `@deprecated`. - `--exclude-lint-eslint`: Don't use eslint-plugin-eslint-comment to enforce good practices around ESLint comment directives. - `--exclude-lint-jsdoc`: Don't use eslint-plugin-jsdoc to enforce good practices around JSDoc comments. diff --git a/docs/Tooling.md b/docs/Tooling.md index b5b87a241..4dc42d729 100644 --- a/docs/Tooling.md +++ b/docs/Tooling.md @@ -267,13 +267,7 @@ pnpm lint:md ### Lint Package JSON -[`npm-package-json-lint`](https://github.com/tclindner/npm-package-json-lint): Linting for `package.json` files. - -```shell -pnpm lint:package-json -``` - -> This is a separate linter from ESLint, but will likely eventually be switched to an ESLint plugin ([#839](https://github.com/JoshuaKGoldberg/create-typescript-app/issues/839)). +[`eslint-plugin-package-json`](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json): Linting for `package.json` files. ### Lint Packages diff --git a/package.json b/package.json index 9802e211b..aa9686b7d 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,7 @@ "name": "create-typescript-app", "version": "1.55.0", "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝", - "repository": { - "type": "git", - "url": "https://github.com/JoshuaKGoldberg/create-typescript-app" - }, + "repository": "JoshuaKGoldberg/create-typescript-app", "license": "MIT", "author": { "name": "Josh Goldberg", @@ -28,7 +25,6 @@ "lint": "eslint . .*js --max-warnings 0", "lint:knip": "knip", "lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line", - "lint:package-json": "npmPkgJsonLint .", "lint:packages": "pnpm dedupe --check", "lint:spelling": "cspell \"**\" \".github/**/*\"", "prepare": "husky install", @@ -84,6 +80,7 @@ "eslint-plugin-markdown": "^3.0.1", "eslint-plugin-n": "^16.3.1", "eslint-plugin-no-only-tests": "^3.1.0", + "eslint-plugin-package-json": "^0.10.0", "eslint-plugin-perfectionist": "^2.5.0", "eslint-plugin-regexp": "^2.1.2", "eslint-plugin-vitest": "^0.3.10", @@ -95,8 +92,6 @@ "lint-staged": "^15.2.0", "markdownlint": "^0.33.0", "markdownlint-cli": "^0.38.0", - "npm-package-json-lint": "^7.1.0", - "npm-package-json-lint-config-default": "^6.0.0", "prettier-plugin-curly": "^0.1.3", "prettier-plugin-packagejson": "^2.4.7", "release-it": "^17.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7cd91e4f..28c39294d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -124,6 +124,9 @@ devDependencies: eslint-plugin-no-only-tests: specifier: ^3.1.0 version: 3.1.0 + eslint-plugin-package-json: + specifier: ^0.10.0 + version: 0.10.0(eslint@8.55.0)(jsonc-eslint-parser@2.4.0) eslint-plugin-perfectionist: specifier: ^2.5.0 version: 2.5.0(eslint@8.55.0)(typescript@5.3.3) @@ -157,12 +160,6 @@ devDependencies: markdownlint-cli: specifier: ^0.38.0 version: 0.38.0 - npm-package-json-lint: - specifier: ^7.1.0 - version: 7.1.0(typescript@5.3.3) - npm-package-json-lint-config-default: - specifier: ^6.0.0 - version: 6.0.0(npm-package-json-lint@7.1.0) prettier-plugin-curly: specifier: ^0.1.3 version: 0.1.3(prettier@3.1.0) @@ -1860,6 +1857,13 @@ packages: resolution: {integrity: sha512-Wrb8zeghhpKbYuqAOg203g+9YSNlrZWNZYvwxJuDF4dTmerijqpnGbI79yCuPtHSXHPEwv1pAFUB4zsSqn82Og==} dev: true + /@types/glob@7.2.0: + resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + dependencies: + '@types/minimatch': 5.1.2 + '@types/node': 20.10.4 + dev: true + /@types/http-cache-semantics@4.0.1: resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==} @@ -1887,8 +1891,8 @@ packages: '@types/unist': 2.0.6 dev: true - /@types/minimist@1.2.2: - resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} + /@types/minimatch@5.1.2: + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} dev: true /@types/node@20.10.4: @@ -2174,14 +2178,6 @@ packages: clean-stack: 2.2.0 indent-string: 4.0.0 - /ajv-errors@1.0.1(ajv@6.12.6): - resolution: {integrity: sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==} - peerDependencies: - ajv: '>=5.0.0' - dependencies: - ajv: 6.12.6 - dev: true - /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -2331,11 +2327,6 @@ packages: is-shared-array-buffer: 1.0.2 dev: true - /arrify@1.0.1: - resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} - engines: {node: '>=0.10.0'} - dev: true - /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true @@ -2574,20 +2565,6 @@ packages: engines: {node: '>=6'} dev: true - /camelcase-keys@6.2.2: - resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} - engines: {node: '>=8'} - dependencies: - camelcase: 5.3.1 - map-obj: 4.3.0 - quick-lru: 4.0.1 - dev: true - - /camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - dev: true - /camelcase@7.0.1: resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} engines: {node: '>=14.16'} @@ -3203,19 +3180,6 @@ packages: ms: 2.1.2 dev: true - /decamelize-keys@1.1.1: - resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} - engines: {node: '>=0.10.0'} - dependencies: - decamelize: 1.2.0 - map-obj: 1.0.1 - dev: true - - /decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - dev: true - /decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -3296,11 +3260,21 @@ packages: /deprecation@2.3.1: resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} + /detect-indent@6.1.0: + resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} + engines: {node: '>=8'} + dev: true + /detect-indent@7.0.1: resolution: {integrity: sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==} engines: {node: '>=12.20'} dev: true + /detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + dev: true + /detect-newline@4.0.0: resolution: {integrity: sha512-1aXUEPdfGdzVPFpzGJJNgq9o81bGg1s09uxTWsqBlo9PI332uyJRQq13+LK/UN4JfxJbFdCXonUFQ9R/p7yCtw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -3718,6 +3692,21 @@ packages: engines: {node: '>=5.0.0'} dev: true + /eslint-plugin-package-json@0.10.0(eslint@8.55.0)(jsonc-eslint-parser@2.4.0): + resolution: {integrity: sha512-vUEfGptdpaEw0DTzN8Yl4cjZ2XZosuzAbZ+kOKJN+tJRe2hZDogesMhNYT8FI26QZ1rYUnfQ0wwzBTjswGr04g==} + engines: {node: '>=18'} + peerDependencies: + eslint: '>=8.0.0' + jsonc-eslint-parser: ^2.0.0 + dependencies: + eslint: 8.55.0 + jsonc-eslint-parser: 2.4.0 + package-json-validator: 0.6.3 + semver: 7.5.4 + sort-package-json: 1.57.0 + validate-npm-package-name: 5.0.0 + dev: true + /eslint-plugin-perfectionist@2.5.0(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-F6XXcq4mKKUe/SREoMGQqzgw6cgCgf3pFzkFfQVIGtqD1yXVpQjnhTepzhBeZfxZwgMzR9HO4yH4CUhIQ2WBcQ==} peerDependencies: @@ -4054,14 +4043,6 @@ packages: engines: {node: '>=18'} dev: true - /find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - dev: true - /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -4228,6 +4209,10 @@ packages: - supports-color dev: true + /git-hooks-list@1.0.3: + resolution: {integrity: sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ==} + dev: true + /git-hooks-list@3.0.0: resolution: {integrity: sha512-XDfdemBGJIMAsHHOONHQxEH5dX2kCpE6MGZ1IsNvBuDPBZM3p4EAwAC7ygMjn/1/x+BJX0TK1ara1Zrh7JCFdQ==} dev: true @@ -4373,6 +4358,20 @@ packages: define-properties: 1.2.0 dev: true + /globby@10.0.0: + resolution: {integrity: sha512-3LifW9M4joGZasyYPz2A1U74zbC/45fvpXUvO/9KbSa+VV0aGZarWkfdgKyR9sExNP0t0x0ss/UMJpNpcaTspw==} + engines: {node: '>=8'} + dependencies: + '@types/glob': 7.2.0 + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + glob: 7.2.3 + ignore: 5.3.0 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -4472,11 +4471,6 @@ packages: uglify-js: 3.17.4 dev: true - /hard-rejection@2.1.0: - resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} - engines: {node: '>=6'} - dev: true - /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true @@ -4529,10 +4523,6 @@ packages: function-bind: 1.1.1 dev: true - /hosted-git-info@2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - dev: true - /hosted-git-info@4.1.0: resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} engines: {node: '>=10'} @@ -4727,11 +4717,6 @@ packages: resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} dev: true - /irregular-plurals@3.3.0: - resolution: {integrity: sha512-MVBLKUTangM3EfRPFROhmWQQKRDsrgI83J8GS3jXy+OwYqiR2/aoWndYQ5416jLE3uaGgLH7ncme3X9y09gZ3g==} - engines: {node: '>=8'} - dev: true - /is-alphabetical@1.0.4: resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} dev: true @@ -4942,14 +4927,9 @@ packages: engines: {node: '>=8'} dev: true - /is-plain-obj@1.1.0: - resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} - engines: {node: '>=0.10.0'} - dev: true - - /is-plain-obj@3.0.0: - resolution: {integrity: sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==} - engines: {node: '>=10'} + /is-plain-obj@2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} dev: true /is-plain-obj@4.1.0: @@ -5248,11 +5228,6 @@ packages: dependencies: json-buffer: 3.0.1 - /kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - dev: true - /knip@4.0.2(@types/node@20.10.4)(typescript@5.3.3): resolution: {integrity: sha512-eIPMiuZmHmjbMe5G+bR8xVai11Qa5DVTtISFBb4McxXkeaB4eHzr+eoo7SRGq153PCO74Pf2XJewNKm0lMp1dw==} engines: {node: '>=18.6.0'} @@ -5401,13 +5376,6 @@ packages: pkg-types: 1.0.3 dev: true - /locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - dependencies: - p-locate: 4.1.0 - dev: true - /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -5592,21 +5560,11 @@ packages: p-defer: 1.0.0 dev: true - /map-obj@1.0.1: - resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} - engines: {node: '>=0.10.0'} - dev: true - /map-obj@2.0.0: resolution: {integrity: sha512-TzQSV2DiMYgoF5RycneKVUzIa9bQsj/B3tTgsE3dOGqlzHnGIDaC7XBE7grnA+8kZPnfqSGFe95VHc2oc0VFUQ==} engines: {node: '>=4'} dev: true - /map-obj@4.3.0: - resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} - engines: {node: '>=8'} - dev: true - /markdown-it@13.0.2: resolution: {integrity: sha512-FtwnEuuK+2yVU7goGn/MJ0WBZMM9ZPgU9spqlFs7/A/pDIUNSOQZhUgOqYCficIuR2QaFnrt8LHqBWsbTAoI5w==} hasBin: true @@ -5734,24 +5692,6 @@ packages: resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==} engines: {node: '>=16.10'} - /meow@9.0.0: - resolution: {integrity: sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==} - engines: {node: '>=10'} - dependencies: - '@types/minimist': 1.2.2 - camelcase-keys: 6.2.2 - decamelize: 1.2.0 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 3.0.3 - read-pkg-up: 7.0.1 - redent: 3.0.0 - trim-newlines: 3.0.1 - type-fest: 0.18.1 - yargs-parser: 20.2.9 - dev: true - /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -5811,11 +5751,6 @@ packages: resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - /min-indent@1.0.1: - resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} - engines: {node: '>=4'} - dev: true - /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -5835,13 +5770,8 @@ packages: dependencies: brace-expansion: 2.0.1 - /minimist-options@4.1.0: - resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} - engines: {node: '>= 6'} - dependencies: - arrify: 1.0.1 - is-plain-obj: 1.1.0 - kind-of: 6.0.3 + /minimist@0.0.10: + resolution: {integrity: sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==} dev: true /minimist@1.2.8: @@ -5948,25 +5878,6 @@ packages: formdata-polyfill: 4.0.10 dev: true - /normalize-package-data@2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - dependencies: - hosted-git-info: 2.8.9 - resolve: 1.22.2 - semver: 5.7.1 - validate-npm-package-license: 3.0.4 - dev: true - - /normalize-package-data@3.0.3: - resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} - engines: {node: '>=10'} - dependencies: - hosted-git-info: 4.1.0 - is-core-module: 2.13.0 - semver: 7.5.4 - validate-npm-package-license: 3.0.4 - dev: true - /normalize-package-data@6.0.0: resolution: {integrity: sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==} engines: {node: ^16.14.0 || >=18.0.0} @@ -6015,42 +5926,6 @@ packages: validate-npm-package-name: 5.0.0 dev: true - /npm-package-json-lint-config-default@6.0.0(npm-package-json-lint@7.1.0): - resolution: {integrity: sha512-Ek3EcbMEjvGSxEywxNF2tTHuzvtaUH48Z7sljmeSejANMSpE1ssIN0oOG/Tlpc+U/P7ElfsOySIjijjmEnvMGw==} - engines: {node: '>=16.0.0', npm: '>=8.0.0'} - peerDependencies: - npm-package-json-lint: ^7.0.0 - dependencies: - npm-package-json-lint: 7.1.0(typescript@5.3.3) - dev: true - - /npm-package-json-lint@7.1.0(typescript@5.3.3): - resolution: {integrity: sha512-ypcMpag32TCP89zzLSS+7vjeR2QY613WzmO2upcJgKNWlcswDz8cdb80urbBNHkhSPI40ex3nsKrRDH/WhMYOg==} - engines: {node: '>=16.0.0', npm: '>=8.0.0'} - hasBin: true - dependencies: - ajv: 6.12.6 - ajv-errors: 1.0.1(ajv@6.12.6) - chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.3.3) - debug: 4.3.4 - globby: 11.1.0 - ignore: 5.3.0 - is-plain-obj: 3.0.0 - jsonc-parser: 3.2.0 - log-symbols: 4.1.0 - meow: 9.0.0 - plur: 4.0.0 - semver: 7.5.4 - slash: 3.0.0 - strip-json-comments: 3.1.1 - type-fest: 4.8.3 - validate-npm-package-name: 5.0.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /npm-pick-manifest@9.0.0: resolution: {integrity: sha512-VfvRSs/b6n9ol4Qb+bDwNGUXutpy76x6MARw/XssevE0TnctIKcmklJZM5Z7nqs5z5aW+0S63pgCNbpkUNNXBg==} engines: {node: ^16.14.0 || >=18.0.0} @@ -6166,6 +6041,13 @@ packages: is-wsl: 2.2.0 dev: true + /optimist@0.6.1: + resolution: {integrity: sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==} + dependencies: + minimist: 0.0.10 + wordwrap: 0.0.3 + dev: true + /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -6230,13 +6112,6 @@ packages: engines: {node: '>=4'} dev: true - /p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - dependencies: - p-try: 2.2.0 - dev: true - /p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} @@ -6258,13 +6133,6 @@ packages: yocto-queue: 1.0.0 dev: true - /p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - dependencies: - p-limit: 2.3.0 - dev: true - /p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} @@ -6294,11 +6162,6 @@ packages: mimic-fn: 3.1.0 dev: true - /p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - dev: true - /pac-proxy-agent@7.0.1: resolution: {integrity: sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==} engines: {node: '>= 14'} @@ -6324,6 +6187,13 @@ packages: netmask: 2.0.2 dev: true + /package-json-validator@0.6.3: + resolution: {integrity: sha512-juKiFboV4UKUvWQ+OSxstnyukhuluyuEoFmgZw1Rx21XzmwlgDWLcbl3qzjA3789IRORYhVFs7cmAO0YFGwHCg==} + hasBin: true + dependencies: + optimist: 0.6.1 + dev: true + /package-json@8.1.0: resolution: {integrity: sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==} engines: {node: '>=14.16'} @@ -6500,13 +6370,6 @@ packages: pathe: 1.1.1 dev: true - /plur@4.0.0: - resolution: {integrity: sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==} - engines: {node: '>=10'} - dependencies: - irregular-plurals: 3.3.0 - dev: true - /postcss-load-config@4.0.1: resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} @@ -6666,11 +6529,6 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true - /quick-lru@4.0.1: - resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} - engines: {node: '>=8'} - dev: true - /quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} @@ -6706,25 +6564,6 @@ packages: type-fest: 4.8.3 dev: true - /read-pkg-up@7.0.1: - resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - read-pkg: 5.2.0 - type-fest: 0.8.1 - dev: true - - /read-pkg@5.2.0: - resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} - engines: {node: '>=8'} - dependencies: - '@types/normalize-package-data': 2.4.1 - normalize-package-data: 2.5.0 - parse-json: 5.2.0 - type-fest: 0.6.0 - dev: true - /read-pkg@8.1.0: resolution: {integrity: sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==} engines: {node: '>=16'} @@ -6757,14 +6596,6 @@ packages: resolve: 1.22.2 dev: true - /redent@3.0.0: - resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} - engines: {node: '>=8'} - dependencies: - indent-string: 4.0.0 - strip-indent: 3.0.0 - dev: true - /refa@0.12.1: resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} @@ -7048,11 +6879,6 @@ packages: semver: 7.5.4 dev: true - /semver@5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} - hasBin: true - dev: true - /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -7187,6 +7013,18 @@ packages: resolution: {integrity: sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==} dev: true + /sort-package-json@1.57.0: + resolution: {integrity: sha512-FYsjYn2dHTRb41wqnv+uEqCUvBpK3jZcTp9rbz2qDTmel7Pmdtf+i2rLaaPMRZeSVM60V3Se31GyWFpmKs4Q5Q==} + hasBin: true + dependencies: + detect-indent: 6.1.0 + detect-newline: 3.1.0 + git-hooks-list: 1.0.3 + globby: 10.0.0 + is-plain-obj: 2.1.0 + sort-object-keys: 1.1.3 + dev: true + /sort-package-json@2.6.0: resolution: {integrity: sha512-XSQ+lY9bAYA8ZsoChcEoPlgcSMaheziEp1beox1JVxy1SV4F2jSq9+h2rJ+3mC/Dhu9Ius1DLnInD5AWcsDXZw==} hasBin: true @@ -7381,13 +7219,6 @@ packages: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - /strip-indent@3.0.0: - resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} - engines: {node: '>=8'} - dependencies: - min-indent: 1.0.1 - dev: true - /strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -7561,11 +7392,6 @@ packages: hasBin: true dev: true - /trim-newlines@3.0.1: - resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} - engines: {node: '>=8'} - dev: true - /ts-api-utils@1.0.1(typescript@5.3.3): resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==} engines: {node: '>=16.13.0'} @@ -7659,11 +7485,6 @@ packages: engines: {node: '>=4'} dev: true - /type-fest@0.18.1: - resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} - engines: {node: '>=10'} - dev: true - /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} @@ -7679,11 +7500,6 @@ packages: engines: {node: '>=8'} dev: true - /type-fest@0.8.1: - resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} - engines: {node: '>=8'} - dev: true - /type-fest@1.4.0: resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} engines: {node: '>=10'} @@ -8127,6 +7943,11 @@ packages: execa: 5.1.1 dev: true + /wordwrap@0.0.3: + resolution: {integrity: sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==} + engines: {node: '>=0.4.0'} + dev: true + /wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} dev: true @@ -8203,11 +8024,6 @@ packages: engines: {node: '>= 14'} dev: true - /yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - dev: true - /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} diff --git a/script/create-test-e2e.js b/script/create-test-e2e.js index 677719037..2419e8b9a 100644 --- a/script/create-test-e2e.js +++ b/script/create-test-e2e.js @@ -28,7 +28,6 @@ for (const command of [ `pnpm run format --list-different`, `pnpm run lint`, `pnpm run lint:md`, - `pnpm run lint:package-json`, `pnpm run lint:packages`, `pnpm run lint:spelling`, `pnpm run lint:knip`, diff --git a/src/bin/help.test.ts b/src/bin/help.test.ts index ee01bd871..507cfa0c9 100644 --- a/src/bin/help.test.ts +++ b/src/bin/help.test.ts @@ -228,7 +228,7 @@ describe("logHelpText", () => { ], [ " - --exclude-lint-package-json: Don't add npm-package-json-lint to lint for + --exclude-lint-package-json: Don't add eslint-plugin-package-json to lint for package.json correctness.", ], [ diff --git a/src/shared/options/args.ts b/src/shared/options/args.ts index 6da755fd0..70c597871 100644 --- a/src/shared/options/args.ts +++ b/src/shared/options/args.ts @@ -119,7 +119,7 @@ export const allArgOptions = { type: "boolean", }, "exclude-lint-package-json": { - description: `Don't add npm-package-json-lint to lint for + description: `Don't add eslint-plugin-package-json to lint for package.json correctness.`, docsSection: "opt-out", type: "boolean", diff --git a/src/shared/options/augmentOptionsWithExcludes.ts b/src/shared/options/augmentOptionsWithExcludes.ts index e1b2576db..747156b1f 100644 --- a/src/shared/options/augmentOptionsWithExcludes.ts +++ b/src/shared/options/augmentOptionsWithExcludes.ts @@ -58,7 +58,8 @@ const exclusionDescriptions: Record = { }, excludeLintPackageJson: { hint: "--exclude-lint-package-json", - label: "Add npm-package-json-lint to lint for package.json correctness.", + label: + "Add eslint-plugin-package-json to lint for package.json correctness.", uncommon: true, }, excludeLintPackages: { diff --git a/src/shared/options/getBase.test.ts b/src/shared/options/getBase.test.ts index 4e7372171..b131d332c 100644 --- a/src/shared/options/getBase.test.ts +++ b/src/shared/options/getBase.test.ts @@ -23,6 +23,7 @@ describe("getBase", () => { expect(await getBase()).toBe("minimum"); }); + it("should return common with common scripts", async () => { mockReadPackageData.mockImplementationOnce(() => Promise.resolve({ @@ -37,6 +38,7 @@ describe("getBase", () => { expect(await getBase()).toBe("common"); }); + it("should return everything with everything scripts", async () => { mockReadPackageData.mockImplementationOnce(() => Promise.resolve({ @@ -45,8 +47,8 @@ describe("getBase", () => { lint: "lint", "lint:knip": "knip", "lint:md": "md", - "lint:package-json": "package-json", "lint:packages": "packages", + "lint:spelling": "spelling", test: "test", }, }), diff --git a/src/shared/options/getBase.ts b/src/shared/options/getBase.ts index 6e7d3bac4..60ba55823 100644 --- a/src/shared/options/getBase.ts +++ b/src/shared/options/getBase.ts @@ -5,10 +5,10 @@ const commonScripts = new Set(["lint:knip", "should-semantic-release", "test"]); const everythingScripts = new Set([ "lint:md", - "lint:package-json", "lint:packages", "lint:spelling", ]); + export async function getBase(): Promise { const scripts = Object.keys((await readPackageData()).scripts ?? {}); diff --git a/src/steps/clearUnnecessaryFiles.ts b/src/steps/clearUnnecessaryFiles.ts index 33845584b..1fd57ed76 100644 --- a/src/steps/clearUnnecessaryFiles.ts +++ b/src/steps/clearUnnecessaryFiles.ts @@ -16,6 +16,7 @@ const globPaths = [ ".eslintrc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", + ".npmpackagejsonlintrc.json", "codecov.yml", "DEVELOPMENT.md", "dist", diff --git a/src/steps/finalizeDependencies.test.ts b/src/steps/finalizeDependencies.test.ts index 0b3d46b77..1191730d4 100644 --- a/src/steps/finalizeDependencies.test.ts +++ b/src/steps/finalizeDependencies.test.ts @@ -38,7 +38,7 @@ describe("finalize", () => { expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(` [ [ - "pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-no-only-tests@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest npm-package-json-lint@latest npm-package-json-lint-config-default@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest should-semantic-release@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D", + "pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-no-only-tests@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest should-semantic-release@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D", ], [ "npx all-contributors-cli generate", @@ -59,7 +59,7 @@ describe("finalize", () => { expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(` [ [ - "pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-no-only-tests@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest npm-package-json-lint@latest npm-package-json-lint-config-default@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest should-semantic-release@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D --offline", + "pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-no-only-tests@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest should-semantic-release@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D --offline", ], [ "npx all-contributors-cli generate", diff --git a/src/steps/finalizeDependencies.ts b/src/steps/finalizeDependencies.ts index 52e294302..ac3073c49 100644 --- a/src/steps/finalizeDependencies.ts +++ b/src/steps/finalizeDependencies.ts @@ -22,9 +22,10 @@ export async function finalizeDependencies(options: Options) { "tsup", "typescript", ...(options.excludeAllContributors ? [] : ["all-contributors-cli"]), - ...(options.excludeLintJson + ...(options.excludeLintJson ? [] : ["eslint-plugin-jsonc"]), + ...(options.excludeLintJson && options.excludeLintPackageJson ? [] - : ["eslint-plugin-jsonc", "jsonc-eslint-parser"]), + : ["jsonc-eslint-parser"]), ...(options.excludeLintKnip ? [] : ["knip"]), ...(options.excludeLintMd ? [] @@ -34,9 +35,7 @@ export async function finalizeDependencies(options: Options) { "markdownlint-cli", "sentences-per-line", ]), - ...(options.excludeLintPackageJson - ? [] - : ["npm-package-json-lint", "npm-package-json-lint-config-default"]), + ...(options.excludeLintPackageJson ? [] : ["eslint-plugin-package-json"]), ...(options.excludeLintPerfectionist ? [] : ["eslint-plugin-perfectionist"]), diff --git a/src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts b/src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts index 9ae29e908..a67866116 100644 --- a/src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts +++ b/src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts @@ -30,7 +30,6 @@ export async function initializeBranchProtectionSettings( { context: "lint" }, { context: "lint_knip" }, { context: "lint_markdown" }, - { context: "lint_package_json" }, { context: "lint_packages" }, { context: "lint_spelling" }, { context: "prettier" }, diff --git a/src/steps/writing/creation/createESLintRC.test.ts b/src/steps/writing/creation/createESLintRC.test.ts index a0361ad5d..900ccb629 100644 --- a/src/steps/writing/creation/createESLintRC.test.ts +++ b/src/steps/writing/creation/createESLintRC.test.ts @@ -195,6 +195,12 @@ describe("createESLintRC", () => { "jsonc/no-comments": "off", }, }, + { + extends: ["plugin:package-json/recommended"], + files: ["package.json"], + parser: "jsonc-eslint-parser", + plugins: ["package-json"], + }, { files: "**/*.test.ts", rules: { diff --git a/src/steps/writing/creation/createESLintRC.ts b/src/steps/writing/creation/createESLintRC.ts index 05f056c58..38283a654 100644 --- a/src/steps/writing/creation/createESLintRC.ts +++ b/src/steps/writing/creation/createESLintRC.ts @@ -140,6 +140,15 @@ module.exports = { "jsonc/no-comments": "off", }, },` + }${ + options.excludeLintPackageJson + ? "" + : `{ + extends: ["plugin:package-json/recommended"], + files: ["package.json"], + parser: "jsonc-eslint-parser", + plugins: ["package-json"], + },` }${ options.excludeTests ? "" diff --git a/src/steps/writing/creation/dotGitHub/createDevelopment/index.test.ts b/src/steps/writing/creation/dotGitHub/createDevelopment/index.test.ts index 202fef504..cddd40e5d 100644 --- a/src/steps/writing/creation/dotGitHub/createDevelopment/index.test.ts +++ b/src/steps/writing/creation/dotGitHub/createDevelopment/index.test.ts @@ -88,7 +88,6 @@ describe("createDevelopment", () => { - \`pnpm lint\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files - \`pnpm lint:knip\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports - \`pnpm lint:md\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files - - \`pnpm lint:package-json\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \`package.json\` file - \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file - \`pnpm lint:spelling\` ([cspell](https://cspell.org)): Spell checks across all source files @@ -325,7 +324,6 @@ Def 456. - \`pnpm lint\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files - \`pnpm lint:knip\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports - \`pnpm lint:md\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files - - \`pnpm lint:package-json\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \`package.json\` file - \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file - \`pnpm lint:spelling\` ([cspell](https://cspell.org)): Spell checks across all source files diff --git a/src/steps/writing/creation/dotGitHub/createDevelopment/index.ts b/src/steps/writing/creation/dotGitHub/createDevelopment/index.ts index 9e3fe9512..56bffab15 100644 --- a/src/steps/writing/creation/dotGitHub/createDevelopment/index.ts +++ b/src/steps/writing/creation/dotGitHub/createDevelopment/index.ts @@ -17,8 +17,6 @@ function createLintingSection(options: Options) { `- \`pnpm lint:knip\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`, !options.excludeLintMd && `- \`pnpm lint:md\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files`, - !options.excludeLintPackageJson && - `- \`pnpm lint:package-json\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \`package.json\` file`, !options.excludeLintPackages && `- \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file`, !options.excludeLintSpelling && diff --git a/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts b/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts index a3b5e438c..7f427262b 100644 --- a/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts +++ b/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts @@ -156,22 +156,6 @@ describe("createWorkflows", () => { name: Lint Markdown - on: - pull_request: ~ - push: - branches: - - main - ", - "lint-package-json.yml": "jobs: - lint_package_json: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/prepare - - run: pnpm lint:package-json - - name: Lint Package JSON - on: pull_request: ~ push: diff --git a/src/steps/writing/creation/dotGitHub/createWorkflows.ts b/src/steps/writing/creation/dotGitHub/createWorkflows.ts index ba67f6493..f101c5ce1 100644 --- a/src/steps/writing/creation/dotGitHub/createWorkflows.ts +++ b/src/steps/writing/creation/dotGitHub/createWorkflows.ts @@ -128,12 +128,6 @@ export function createWorkflows(options: Options) { runs: ["pnpm lint:md"], }), }), - ...(!options.excludeLintPackageJson && { - "lint-package-json.yml": createWorkflowFile({ - name: "Lint Package JSON", - runs: ["pnpm lint:package-json"], - }), - }), ...(!options.excludeLintPackages && { "lint-packages.yml": createWorkflowFile({ name: "Lint Packages", diff --git a/src/steps/writing/creation/rootFiles.ts b/src/steps/writing/creation/rootFiles.ts index ff956f58a..68b860e45 100644 --- a/src/steps/writing/creation/rootFiles.ts +++ b/src/steps/writing/creation/rootFiles.ts @@ -25,15 +25,6 @@ export async function createRootFiles(options: Options) { "node_modules/", ]), }), - ...(!options.excludeLintPackageJson && { - ".npmpackagejsonlintrc.json": await formatJson({ - extends: "npm-package-json-lint-config-default", - rules: { - "require-description": "error", - "require-license": "error", - }, - }), - }), ".nvmrc": `20.11.0\n`, ".prettierignore": formatIgnoreFile([ ...(options.excludeAllContributors ? [] : [".all-contributorsrc"]), diff --git a/src/steps/writing/creation/writePackageJson.test.ts b/src/steps/writing/creation/writePackageJson.test.ts index 22ee9f2c6..d0b565fa3 100644 --- a/src/steps/writing/creation/writePackageJson.test.ts +++ b/src/steps/writing/creation/writePackageJson.test.ts @@ -105,7 +105,6 @@ describe("writePackageJson", () => { "lint": "eslint . .*js --max-warnings 0", "lint:knip": "knip", "lint:md": "markdownlint "**/*.md" ".github/**/*.md" --rules sentences-per-line", - "lint:package-json": "npmPkgJsonLint .", "lint:packages": "pnpm dedupe --check", "lint:spelling": "cspell "**" ".github/**/*"", "prepare": "husky install", diff --git a/src/steps/writing/creation/writePackageJson.ts b/src/steps/writing/creation/writePackageJson.ts index 01cd99712..a98050a2a 100644 --- a/src/steps/writing/creation/writePackageJson.ts +++ b/src/steps/writing/creation/writePackageJson.ts @@ -95,9 +95,6 @@ export async function writePackageJson(options: Options) { "lint:md": 'markdownlint "**/*.md" ".github/**/*.md" --rules sentences-per-line', }), - ...(!options.excludeLintPackageJson && { - "lint:package-json": "npmPkgJsonLint .", - }), ...(!options.excludeLintPackages && { "lint:packages": "pnpm dedupe --check", }),