diff --git a/packages/lint-package-json/package.json b/packages/lint-package-json/package.json index 1a4d0b8..e964172 100644 --- a/packages/lint-package-json/package.json +++ b/packages/lint-package-json/package.json @@ -33,7 +33,7 @@ "postpublish": "del ./package" }, "dependencies": { - "@trigen/npm-package-json-lint-config": "^8.0.0-alpha.33", + "@trigen/npm-package-json-lint-config": "workspace:^", "argue-cli": "^2.1.0", "npm-package-json-lint": "^9.0.0" } diff --git a/packages/lint-package-json/src/configs.cjs b/packages/lint-package-json/src/configs.cjs deleted file mode 100644 index 79d8dd0..0000000 --- a/packages/lint-package-json/src/configs.cjs +++ /dev/null @@ -1,2 +0,0 @@ -exports.base = require.resolve('@trigen/npm-package-json-lint-config') -exports.monorepo = require.resolve('@trigen/npm-package-json-lint-config/monorepo') diff --git a/packages/lint-package-json/src/index.js b/packages/lint-package-json/src/index.js index 3f3240b..8286301 100755 --- a/packages/lint-package-json/src/index.js +++ b/packages/lint-package-json/src/index.js @@ -8,7 +8,8 @@ import { NpmPackageJsonLint, write } from 'npm-package-json-lint' -import configs from './configs.cjs' +import baseConfig from '@trigen/npm-package-json-lint-config' +import monorepoConfig from '@trigen/npm-package-json-lint-config/monorepo' const { monorepo, @@ -17,11 +18,9 @@ const { option(alias('monorepo', 'm'), Boolean), option(alias('ignore', 'i'), Array) ) -const config = { - extends: monorepo - ? [configs.base, configs.monorepo] - : configs.base -} +const config = monorepo + ? monorepoConfig + : baseConfig const npmPackageJsonLint = new NpmPackageJsonLint({ cwd: process.cwd(), config, diff --git a/packages/npm-package-json-lint-config/eslint.config.mjs b/packages/npm-package-json-lint-config/eslint.config.mjs index f31eed0..52af74f 100644 --- a/packages/npm-package-json-lint-config/eslint.config.mjs +++ b/packages/npm-package-json-lint-config/eslint.config.mjs @@ -1,4 +1,12 @@ -import commonjsConfig from '@trigen/eslint-config/commonjs' +import moduleConfig from '@trigen/eslint-config/module' import rootConfig from '../../eslint.config.js' -export default [...rootConfig, ...commonjsConfig] +export default [ + ...rootConfig, + ...moduleConfig, + { + rules: { + 'import/no-default-export': 'off' + } + } +] diff --git a/packages/npm-package-json-lint-config/package.json b/packages/npm-package-json-lint-config/package.json index b2292d5..6bb41d6 100644 --- a/packages/npm-package-json-lint-config/package.json +++ b/packages/npm-package-json-lint-config/package.json @@ -1,5 +1,6 @@ { "name": "@trigen/npm-package-json-lint-config", + "type": "module", "version": "8.0.0", "description": "Trigen's npm-package-json-lint config.", "author": "dangreen", diff --git a/packages/npm-package-json-lint-config/src/index.js b/packages/npm-package-json-lint-config/src/index.js index 9dfaf2e..eadb712 100644 --- a/packages/npm-package-json-lint-config/src/index.js +++ b/packages/npm-package-json-lint-config/src/index.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from 'node:module' + +const require = createRequire(import.meta.url) + +export default { extends: require.resolve('npm-package-json-lint-config-default'), rules: { 'require-author': 'error', diff --git a/packages/npm-package-json-lint-config/src/monorepo.js b/packages/npm-package-json-lint-config/src/monorepo.js index 263df41..e7909b4 100644 --- a/packages/npm-package-json-lint-config/src/monorepo.js +++ b/packages/npm-package-json-lint-config/src/monorepo.js @@ -1,7 +1,9 @@ -const base = require('.') +import base from './index.js' -module.exports = { +export default { + ...base, rules: { + ...base.rules, 'require-version': 'off', 'require-keywords': 'off', 'require-private': 'error', @@ -11,11 +13,11 @@ module.exports = { { patterns: ['packages/*/package.json'], rules: { + ...base.rules, 'require-version': 'error', 'require-private': 'off', 'valid-values-private': 'off', - 'require-repository-directory': 'error', - ...base.rules + 'require-repository-directory': 'error' } } ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c104926..8afc71f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -112,8 +112,8 @@ importers: packages/lint-package-json: dependencies: '@trigen/npm-package-json-lint-config': - specifier: ^8.0.0-alpha.33 - version: 8.0.0(npm-package-json-lint@9.0.0) + specifier: workspace:^ + version: link:../npm-package-json-lint-config argue-cli: specifier: ^2.1.0 version: 2.1.0 @@ -808,67 +808,56 @@ packages: resolution: {integrity: sha512-+xmiDGGaSfIIOXMzkhJ++Oa0Gwvl9oXUeIiwarsdRXSe27HUIvjbSIpPxvnNsRebsNdUo7uAiQVgBD1hVriwSQ==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.44.2': resolution: {integrity: sha512-bDHvhzOfORk3wt8yxIra8N4k/N0MnKInCW5OGZaeDYa/hMrdPaJzo7CSkjKZqX4JFUWjUGm88lI6QJLCM7lDrA==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.44.2': resolution: {integrity: sha512-NMsDEsDiYghTbeZWEGnNi4F0hSbGnsuOG+VnNvxkKg0IGDvFh7UVpM/14mnMwxRxUf9AdAVJgHPvKXf6FpMB7A==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.44.2': resolution: {integrity: sha512-lb5bxXnxXglVq+7imxykIp5xMq+idehfl+wOgiiix0191av84OqbjUED+PRC5OA8eFJYj5xAGcpAZ0pF2MnW+A==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.44.2': resolution: {integrity: sha512-Yl5Rdpf9pIc4GW1PmkUGHdMtbx0fBLE1//SxDmuf3X0dUC57+zMepow2LK0V21661cjXdTn8hO2tXDdAWAqE5g==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.44.2': resolution: {integrity: sha512-03vUDH+w55s680YYryyr78jsO1RWU9ocRMaeV2vMniJJW/6HhoTBwyyiiTPVHNWLnhsnwcQ0oH3S9JSBEKuyqw==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.44.2': resolution: {integrity: sha512-iYtAqBg5eEMG4dEfVlkqo05xMOk6y/JXIToRca2bAWuqjrJYJlx/I7+Z+4hSrsWU8GdJDFPL4ktV3dy4yBSrzg==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.44.2': resolution: {integrity: sha512-e6vEbgaaqz2yEHqtkPXa28fFuBGmUJ0N2dOJK8YUfijejInt9gfCSA7YDdJ4nYlv67JfP3+PSWFX4IVw/xRIPg==} cpu: [riscv64] os: [linux] - libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.44.2': resolution: {integrity: sha512-evFOtkmVdY3udE+0QKrV5wBx7bKI0iHz5yEVx5WqDJkxp9YQefy4Mpx3RajIVcM6o7jxTvVd/qpC1IXUhGc1Mw==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.44.2': resolution: {integrity: sha512-/bXb0bEsWMyEkIsUL2Yt5nFB5naLAwyOWMEviQfQY1x3l5WsLKgvZf66TM7UTfED6erckUVUJQ/jJ1FSpm3pRQ==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.44.2': resolution: {integrity: sha512-3D3OB1vSSBXmkGEZR27uiMRNiwN08/RVAcBKwhUYPaiZ8bcvdeEwWPvbnXvvXHY+A/7xluzcN+kaiOFNiOZwWg==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.44.2': resolution: {integrity: sha512-VfU0fsMK+rwdK8mwODqYeM2hDrF2WiHaSmCBrS7gColkQft95/8tphyzv2EupVxn3iE0FI78wzffoULH1G+dkw==} @@ -919,12 +908,6 @@ packages: peerDependencies: stylelint: ^16.22.0 - '@trigen/npm-package-json-lint-config@8.0.0': - resolution: {integrity: sha512-7if7kPQ5Xvuo6q9Ohk9L2X1ZvCm2JFEd9f0Lw5owAYOolgItJetMHenIzYkrgbI4Reyb+xmlFK2cYuzBS/KGtw==} - engines: {node: '>=20'} - peerDependencies: - npm-package-json-lint: '>= 2' - '@types/chai@5.2.2': resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} @@ -4154,11 +4137,6 @@ snapshots: style-search: 0.1.0 stylelint: 16.25.0 - '@trigen/npm-package-json-lint-config@8.0.0(npm-package-json-lint@9.0.0)': - dependencies: - npm-package-json-lint: 9.0.0 - npm-package-json-lint-config-default: 8.0.1(npm-package-json-lint@9.0.0) - '@types/chai@5.2.2': dependencies: '@types/deep-eql': 4.0.2