diff --git a/apps/README.md b/apps/README.md index c15bf8d870c81..e0eb4d8995c0a 100644 --- a/apps/README.md +++ b/apps/README.md @@ -17,3 +17,8 @@ You must manually build apps by running: ```bash npx lerna run build --scope="@automattic/app-name" ``` + +## Validating package.json +Running `npm run lint:package-json` will lint all `package.json`'s under `./apps/**` based on [`npmpackagejsonlint.config.js`](../npmpackagejsonlint.config.js). + +If you need exceptions to linting rules, add them to overrides section in the config file. diff --git a/apps/full-site-editing/package.json b/apps/full-site-editing/package.json index c7cf6c7b219f3..6eccc32437176 100644 --- a/apps/full-site-editing/package.json +++ b/apps/full-site-editing/package.json @@ -9,7 +9,7 @@ "directory": "apps/full-site-editing" }, "private": true, - "author": "Automattic, Inc.", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bugs": { "url": "https://github.com/Automattic/wp-calypso/issues" diff --git a/apps/notifications/package.json b/apps/notifications/package.json index ba8404a53d8dd..bd9446fdd2ac4 100644 --- a/apps/notifications/package.json +++ b/apps/notifications/package.json @@ -10,7 +10,7 @@ "directory": "apps/notifications" }, "private": true, - "author": "Automattic, Inc.", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bugs": { "url": "https://github.com/Automattic/wp-calypso/issues" diff --git a/apps/o2-blocks/package.json b/apps/o2-blocks/package.json index 231b281cb650c..3e038d9ad7cdf 100644 --- a/apps/o2-blocks/package.json +++ b/apps/o2-blocks/package.json @@ -10,7 +10,7 @@ "directory": "packages/o2-blocks" }, "private": true, - "author": "Automattic, Inc.", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bugs": { "url": "https://github.com/Automattic/wp-calypso/issues" diff --git a/apps/wpcom-block-editor/package.json b/apps/wpcom-block-editor/package.json index 688710cbfa47f..a53ea48c14a23 100644 --- a/apps/wpcom-block-editor/package.json +++ b/apps/wpcom-block-editor/package.json @@ -9,7 +9,7 @@ "directory": "apps/wpcom-block-editor" }, "private": true, - "author": "Automattic, Inc.", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bugs": { "url": "https://github.com/Automattic/wp-calypso/issues" diff --git a/docs/monorepo.md b/docs/monorepo.md index bfa4c84d77f0c..a9abdab91926e 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -51,7 +51,7 @@ The only exception are `devDependencies` which _must be declared in the wp-calyp "module": "dist/esm/index.js", "sideEffects": false, "keywords": [ "wordpress" ], - "author": "Your Name (https://yoursite.wordpress.com/)", + "author": "Automattic Inc.", "contributors": [], "homepage": "https://github.com/Automattic/wp-calypso", "license": "GPL-2.0-or-later", @@ -77,6 +77,8 @@ The only exception are `devDependencies` which _must be declared in the wp-calyp If your package requires compilation, the `package.json` `prepare` script should compile the package. If it contains ES6+ code that needs to be transpiled, use `transpile` (from `@automattic/calypso-build`) which will automatically compile code in `src/` to `dist/cjs` (CommonJS) and `dist/esm` (ECMAScript Modules) by running `babel` over any source files it finds. +Running `npm run lint:package-json` will lint all `package.json`'s under `./packages|apps/**` based on [`npmpackagejsonlint.config.js`](../npmpackagejsonlint.config.js). + ## Running Tests To run all of the package tests: diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d3f000aed7b5f..25517a09b4512 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2675,11 +2675,39 @@ "glob-to-regexp": "^0.3.0" } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + } + } + }, "@nodelib/fs.stat": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@octokit/endpoint": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.0.tgz", @@ -4178,6 +4206,12 @@ "lodash": "^4.17.15" } }, + "@wordpress/npm-package-json-lint-config": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-2.1.0.tgz", + "integrity": "sha512-NSwcK7GtlmW5O5ZMG7elRKBa9sPws17Sadjlztig6ShOuhlLFeHYk99tUenpmJ/PYOZex4fSJ5e9mqjPyKunjw==", + "dev": true + }, "@wordpress/nux": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-3.7.2.tgz", @@ -9981,6 +10015,15 @@ "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==" }, + "fastq": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", + "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "dev": true, + "requires": { + "reusify": "^1.0.0" + } + }, "faye-websocket": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", @@ -12109,6 +12152,12 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, + "irregular-plurals": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-2.0.0.tgz", + "integrity": "sha512-Y75zBYLkh0lJ9qxeHlMjQ7bSbyiSqNW/UOPWDmzC7cXskL1hekSITh1Oc6JV0XCWWZ9DE8VYSB71xocLk3gmGw==", + "dev": true + }, "is-absolute-url": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", @@ -16597,6 +16646,211 @@ "validate-npm-package-name": "^3.0.0" } }, + "npm-package-json-lint": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/npm-package-json-lint/-/npm-package-json-lint-4.0.3.tgz", + "integrity": "sha512-cuvTR2l5dOjjlRR3a1CCp+mh2A2HyQRxydwdcYi0Z77NRlADpf7wF3Jf8XFLGZM7J6afXNRBofBjQ1UWFyOtKA==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "ajv-errors": "^1.0.1", + "chalk": "^2.4.2", + "cosmiconfig": "^5.2.1", + "debug": "^4.1.1", + "globby": "^10.0.1", + "ignore": "^5.1.4", + "is-plain-obj": "^2.0.0", + "log-symbols": "^3.0.0", + "meow": "^5.0.0", + "plur": "^3.1.1", + "semver": "^6.3.0", + "strip-json-comments": "^3.0.1" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "fast-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.0.tgz", + "integrity": "sha512-TrUz3THiq2Vy3bjfQUB2wNyPdGBeGmdjbzzBLhfHN4YFurYptCKwGq/TfiRavbGywFRzY6U2CdmQ1zmsY5yYaw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.0.0.tgz", + "integrity": "sha512-EYisGhpgSCwspmIuRHGjROWTon2Xp8Z7U03Wubk/bTL5TTRC5R1rGVgyjzBrk9+ULdH6cRD06KRcw/xfqhVYKQ==", + "dev": true + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + } + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, "npm-packlist": { "version": "1.4.6", "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.6.tgz", @@ -17415,6 +17669,12 @@ "url": "^0.11.0" } }, + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "dev": true + }, "pidtree": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz", @@ -17504,6 +17764,15 @@ "semver-compare": "^1.0.0" } }, + "plur": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/plur/-/plur-3.1.1.tgz", + "integrity": "sha512-t1Ax8KUvV3FFII8ltczPn2tJdjqbd1sIzu6t4JL7nQ3EyeL/lTrj5PWKb06ic5/6XYDr65rQ4uzQEGN70/6X5w==", + "dev": true, + "requires": { + "irregular-plurals": "^2.0.0" + } + }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -20825,6 +21094,12 @@ "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=" }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rgb-regex": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", diff --git a/npmpackagejsonlint.config.js b/npmpackagejsonlint.config.js new file mode 100644 index 0000000000000..057214b8a3d2f --- /dev/null +++ b/npmpackagejsonlint.config.js @@ -0,0 +1,44 @@ +module.exports = { + // See https://www.npmjs.com/package/@wordpress/npm-package-json-lint-config + extends: '@wordpress/npm-package-json-lint-config', + rules: { + 'prefer-no-devDependencies': 'error', + 'prefer-property-order': 'off', + 'require-bugs': 'off', + 'require-homepage': 'off', + 'require-keywords': 'off', + 'valid-values-author': [ 'error', [ 'Automattic Inc.' ] ], + 'valid-values-name-scope': [ 'error', [ '@automattic' ] ], + }, + overrides: [ + { + patterns: [ + './apps/full-site-editing/package.json', + './apps/wpcom-block-editor/package.json', + './package.json', + ], + rules: { + 'prefer-no-devDependencies': 'off', + }, + }, + { + patterns: [ + './package.json', + './packages/eslint-config-wpcalypso/package.json', + './packages/eslint-plugin-wpcalypso/package.json', + './packages/i18n-calypso-cli/package.json', + './packages/i18n-calypso/package.json', + './packages/photon/package.json', + ], + rules: { + 'valid-values-name-scope': 'off', + }, + }, + { + patterns: [ './packages/material-design-icons/package.json' ], + rules: { + 'valid-values-license': 'off', + }, + }, + ], +}; diff --git a/package.json b/package.json index 29efb3e5c6c64..e6f1f51671265 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "wp-calypso", + "author": "Automattic Inc.", "version": "0.17.0", "description": "A pure REST-API and JS based version of the WordPress.com admin", "private": true, @@ -256,6 +257,7 @@ "lint:css": "stylelint \"**/*.scss\" --syntax scss", "lint:js": "npm run -s install-if-deps-outdated && eslint --ext .js --ext .jsx --ext .ts --ext .tsx --cache .", "lint:mixedindent": "mixedindentlint --ignore-comments \"client/**/*.scss\" \"assets/**/*.scss\" \"**/*.js\" \"**/*.jsx\" \"**/*.tsx\" \"**/*.tsx\" \"!build/**\" \"!node_modules/**\" \"!public/**\" \"!client/config/index.js\"", + "lint:package-json": "npmPkgJsonLint './package.json' './packages/*/package.json' './apps/*/package.json'", "prestart": "npx check-node-version --package && npm run -s install-if-deps-outdated && node bin/welcome.js", "start": "npm run -s build", "poststart": "run-p -s start-build-if-web start-build-if-desktop", @@ -323,6 +325,7 @@ "@wordpress/babel-plugin-makepot": "3.2.1", "@wordpress/browserslist-config": "2.6.0", "@wordpress/dependency-extraction-webpack-plugin": "2.0.0", + "@wordpress/npm-package-json-lint-config": "2.1.0", "babel-eslint": "10.0.3", "babel-jest": "24.9.0", "babel-plugin-dynamic-import-node": "2.3.0", @@ -355,6 +358,7 @@ "ncp": "2.0.0", "nock": "10.0.6", "npm-merge-driver": "2.3.5", + "npm-package-json-lint": "4.0.3", "prettier": "npm:wp-prettier@1.18.2", "react-test-renderer": "16.10.2", "readline-sync": "1.4.9", diff --git a/packages/README.md b/packages/README.md index 3d26bbff96fd0..e85d95363e6f1 100644 --- a/packages/README.md +++ b/packages/README.md @@ -17,3 +17,8 @@ If you must manually build a single package, run: ```bash npx lerna run prepare --scope="@automattic/package-name" ``` + +## Validating package.json +Running `npm run lint:package-json` will lint all `package.json`'s under `./packages/**` based on [`npmpackagejsonlint.config.js`](../npmpackagejsonlint.config.js). + +If you need exceptions to linting rules, add them to overrides section in the config file. diff --git a/packages/babel-plugin-i18n-calypso/package.json b/packages/babel-plugin-i18n-calypso/package.json index c91ebf8ae93fe..3812590def88f 100644 --- a/packages/babel-plugin-i18n-calypso/package.json +++ b/packages/babel-plugin-i18n-calypso/package.json @@ -19,7 +19,7 @@ "directory": "packages/babel-plugin-i18n-calypso" }, "keywords": [], - "author": "Alex Kirk (https://automattic.com)", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "scripts": { "clean": "npx rimraf dist", diff --git a/packages/babel-plugin-transform-wpcalypso-async/package.json b/packages/babel-plugin-transform-wpcalypso-async/package.json index 56c109655e1b8..c4fae373655b9 100644 --- a/packages/babel-plugin-transform-wpcalypso-async/package.json +++ b/packages/babel-plugin-transform-wpcalypso-async/package.json @@ -1,5 +1,13 @@ { "name": "@automattic/babel-plugin-transform-wpcalypso-async", "version": "1.0.1", - "private": true + "private": true, + "license": "GPL-2.0-or-later", + "author": "Automattic Inc.", + "description": "A Babel plugin to facilitate optional code-splitting by applying transformations to a `asyncRequire` global function or the `` React component", + "repository": { + "type": "git", + "url": "git://github.com/Automattic/wp-calypso.git", + "directory": "packages/babel-plugin-transform-wpcalypso-async" + } } diff --git a/packages/calypso-build/package.json b/packages/calypso-build/package.json index 67344596b94f2..7bb4e5b370fa8 100644 --- a/packages/calypso-build/package.json +++ b/packages/calypso-build/package.json @@ -11,7 +11,7 @@ "webpack", "wordpress" ], - "author": "Automattic", + "author": "Automattic Inc.", "homepage": "https://github.com/Automattic/wp-calypso", "license": "GPL-2.0-or-later", "repository": { diff --git a/packages/calypso-color-schemes/package.json b/packages/calypso-color-schemes/package.json index 5cb9f2558f596..9ded013ce26bf 100644 --- a/packages/calypso-color-schemes/package.json +++ b/packages/calypso-color-schemes/package.json @@ -2,7 +2,7 @@ "name": "@automattic/calypso-color-schemes", "version": "2.1.0", "description": "Calypso Shared Style Bits", - "author": "Automattic", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "keywords": [ "calypso", diff --git a/packages/components/package.json b/packages/components/package.json index 4588c68075fca..9bc34324dc4b3 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -4,7 +4,7 @@ "description": "Automattic Components", "homepage": "https://github.com/Automattic/wp-calypso", "license": "GPL-2.0-or-later", - "author": "Automattic", + "author": "Automattic Inc.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "sideEffects": [ diff --git a/packages/composite-checkout/package.json b/packages/composite-checkout/package.json index 1ba8eaa9aa5f4..c946351fa4544 100644 --- a/packages/composite-checkout/package.json +++ b/packages/composite-checkout/package.json @@ -27,7 +27,7 @@ "url": "git+https://github.com/Automattic/wp-calypso.git", "directory": "packages/composite-checkout" }, - "author": "@automattic", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bugs": { "url": "https://github.com/Automattic/wp-calypso/issues" diff --git a/packages/eslint-config-wpcalypso/package.json b/packages/eslint-config-wpcalypso/package.json index 7b3c8149f155f..13278b746414d 100644 --- a/packages/eslint-config-wpcalypso/package.json +++ b/packages/eslint-config-wpcalypso/package.json @@ -5,7 +5,7 @@ "keywords": [ "eslint" ], - "author": "Automattic", + "author": "Automattic Inc.", "contributors": [ { "name": "Andrew Duthie", diff --git a/packages/eslint-plugin-wpcalypso/package.json b/packages/eslint-plugin-wpcalypso/package.json index 4bea360ef1eac..9166483551db2 100644 --- a/packages/eslint-plugin-wpcalypso/package.json +++ b/packages/eslint-plugin-wpcalypso/package.json @@ -13,7 +13,7 @@ "eslintplugin", "eslint-plugin" ], - "author": "Automattic", + "author": "Automattic Inc.", "main": "lib/index.js", "files": [ "lib/" diff --git a/packages/format-currency/package.json b/packages/format-currency/package.json index d0969135331c7..eea4c2bded562 100644 --- a/packages/format-currency/package.json +++ b/packages/format-currency/package.json @@ -17,7 +17,7 @@ "currency", "internationalization" ], - "author": "Automattic, Inc.", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bugs": { "url": "https://github.com/Automattic/wp-calypso/issues" diff --git a/packages/i18n-calypso-cli/package.json b/packages/i18n-calypso-cli/package.json index ff980fd3e2a7b..bc56f950021b9 100644 --- a/packages/i18n-calypso-cli/package.json +++ b/packages/i18n-calypso-cli/package.json @@ -8,7 +8,7 @@ "url": "git+https://github.com/Automattic/wp-calypso.git", "directory": "packages/i18n-calypso-cli" }, - "author": "@automattic", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bin": { "i18n-calypso": "cli.js" diff --git a/packages/i18n-calypso/package.json b/packages/i18n-calypso/package.json index 76199b8878b35..a3c30a4ef7232 100644 --- a/packages/i18n-calypso/package.json +++ b/packages/i18n-calypso/package.json @@ -11,7 +11,7 @@ "url": "git+https://github.com/Automattic/wp-calypso.git", "directory": "packages/i18n-calypso" }, - "author": "@automattic", + "author": "Automattic Inc.", "license": "GPL-2.0-or-later", "bugs": { "url": "https://github.com/Automattic/wp-calypso/issues" diff --git a/packages/load-script/package.json b/packages/load-script/package.json index 7c09b8aa1e38f..142a135a967d2 100644 --- a/packages/load-script/package.json +++ b/packages/load-script/package.json @@ -7,7 +7,7 @@ "keywords": [ "wordpress" ], - "author": "Automattic", + "author": "Automattic Inc.", "homepage": "https://github.com/Automattic/wp-calypso", "license": "GPL-2.0-or-later", "repository": { diff --git a/packages/material-design-icons/package.json b/packages/material-design-icons/package.json index d44336b610ff6..aae11a48e758e 100644 --- a/packages/material-design-icons/package.json +++ b/packages/material-design-icons/package.json @@ -8,7 +8,7 @@ "keywords": [ "wordpress" ], - "author": "Brad Griffith ", + "author": "Automattic Inc.", "contributors": [], "homepage": "https://github.com/Automattic/wp-calypso", "license": "Apache-2.0", diff --git a/packages/muriel-style/package.json b/packages/muriel-style/package.json index 5c26ed22d3557..a87ebc252349e 100644 --- a/packages/muriel-style/package.json +++ b/packages/muriel-style/package.json @@ -11,7 +11,7 @@ "typography", "sass" ], - "author": "@automattic", + "author": "Automattic Inc.", "repository": { "type": "git", "url": "git+https://github.com/Automattic/wp-calypso.git", @@ -21,5 +21,6 @@ "url": "https://github.com/Automattic/wp-calypso/issues" }, "homepage": "https://github.com/Automattic/wp-calypso/tree/master/packages/muriel-style#readme", - "private": true + "private": true, + "license": "GPL-2.0-or-later" } diff --git a/packages/photon/package.json b/packages/photon/package.json index 365a30eceded1..36e33e6c1fa21 100644 --- a/packages/photon/package.json +++ b/packages/photon/package.json @@ -21,7 +21,7 @@ "api", "library" ], - "author": "Automattic, Inc.", + "author": "Automattic Inc.", "contributors": [ "Nathan Rajlich " ], diff --git a/packages/tree-select/package.json b/packages/tree-select/package.json index 62368e5a08da0..56ed59435a54e 100644 --- a/packages/tree-select/package.json +++ b/packages/tree-select/package.json @@ -6,7 +6,7 @@ "redux", "selector" ], - "author": "Jake Fried ", + "author": "Automattic Inc.", "homepage": "https://github.com/Automattic/wp-calypso", "license": "GPL-2.0-or-later", "main": "dist/cjs/index.js", diff --git a/packages/webpack-extensive-lodash-replacement-plugin/package.json b/packages/webpack-extensive-lodash-replacement-plugin/package.json index fcf6a7487f7a8..df17ef29fade3 100644 --- a/packages/webpack-extensive-lodash-replacement-plugin/package.json +++ b/packages/webpack-extensive-lodash-replacement-plugin/package.json @@ -2,6 +2,7 @@ "name": "@automattic/webpack-extensive-lodash-replacement-plugin", "private": true, "version": "0.0.2", + "author": "Automattic Inc.", "description": "Webpack plugin to replace lodash, lodash/foo and lodash.foo imports with lodash-es", "keywords": [ "Webpack", diff --git a/packages/webpack-inline-constant-exports-plugin/package.json b/packages/webpack-inline-constant-exports-plugin/package.json index c3be230a72bfe..bcfff88a4e246 100644 --- a/packages/webpack-inline-constant-exports-plugin/package.json +++ b/packages/webpack-inline-constant-exports-plugin/package.json @@ -1,12 +1,13 @@ { "name": "@automattic/webpack-inline-constant-exports-plugin", "version": "0.0.1", + "author": "Automattic Inc.", "description": "Webpack plugin to inline constant exports from modules", + "license": "GPL-2.0-or-later", "keywords": [ "Webpack" ], "homepage": "https://github.com/Automattic/wp-calypso/tree/master/packages/webpack-inline-constant-exports-plugin", - "license": "GPL-2.0-or-later", "publishConfig": { "access": "public" },