From a9b439843f574917729521407a1903cfbc42a43d Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Mar 2025 07:42:18 -0700 Subject: [PATCH 1/6] chore(deps)!: update dependency eslint to v9 --- package-lock.json | 403 +++++++++++++++++++++++----------------------- package.json | 4 +- 2 files changed, 203 insertions(+), 204 deletions(-) diff --git a/package-lock.json b/package-lock.json index e214a14..a59f5d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@commitlint/cli": "19.8.0", "@commitlint/config-conventional": "19.8.0", "@commitlint/types": "19.8.0", - "eslint": "8.57.1", + "eslint": "9.23.0", "husky": "8.0.3", "scratch-semantic-release-config": "3.0.0", "semantic-release": "24.2.3" @@ -23,7 +23,7 @@ }, "peerDependencies": { "@babel/eslint-parser": "^7.11.0", - "eslint": "^8.0.0" + "eslint": "^9.23.0" } }, "node_modules/@ampproject/remapping": { @@ -626,17 +626,51 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "devOptional": true, + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz", + "integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==", + "devOptional": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "devOptional": true, + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "devOptional": true, - "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -644,7 +678,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -655,7 +689,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "devOptional": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -668,16 +701,12 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "devOptional": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -687,46 +716,72 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "devOptional": true + }, + "node_modules/@eslint/js": { + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz", + "integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==", "devOptional": true, - "license": "MIT" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "devOptional": true, - "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", + "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "devOptional": true, + "dependencies": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "devOptional": true, - "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=18.18.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "devOptional": true, - "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "devOptional": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/module-importer": { @@ -743,13 +798,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", "devOptional": true, - "license": "BSD-3-Clause" + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", @@ -823,7 +883,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -837,7 +897,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -847,7 +907,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -1672,6 +1732,18 @@ "@types/node": "*" } }, + "node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "devOptional": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "devOptional": true + }, "node_modules/@types/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", @@ -1696,19 +1768,11 @@ "dev": true, "license": "MIT" }, - "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", - "devOptional": true, - "license": "ISC" - }, "node_modules/acorn": { "version": "8.14.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "devOptional": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -1721,7 +1785,6 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "devOptional": true, - "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -2947,19 +3010,6 @@ "node": ">=8" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "devOptional": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -3409,60 +3459,63 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", + "integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==", "devOptional": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/config-helpers": "^0.2.0", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.23.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-plugin-react": { @@ -3580,30 +3633,28 @@ } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "devOptional": true, - "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "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": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "devOptional": true, - "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -3626,22 +3677,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3707,19 +3742,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "devOptional": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -3734,31 +3756,29 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "devOptional": true, - "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "devOptional": true, - "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -3923,7 +3943,7 @@ "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -3946,16 +3966,15 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "devOptional": true, - "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { @@ -4020,26 +4039,23 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "devOptional": true, - "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "devOptional": true, - "license": "ISC" + "devOptional": true }, "node_modules/for-each": { "version": "0.3.5", @@ -4087,7 +4103,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/function-bind": { @@ -4294,7 +4310,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -4409,13 +4425,6 @@ "dev": true, "license": "ISC" }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "devOptional": true, - "license": "MIT" - }, "node_modules/handlebars": { "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", @@ -4739,7 +4748,7 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -4750,7 +4759,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/ini": { @@ -5069,7 +5078,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5342,7 +5351,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", - "dev": true, + "devOptional": true, "license": "MIT", "bin": { "jiti": "lib/jiti-cli.mjs" @@ -5386,8 +5395,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "devOptional": true, - "license": "MIT" + "devOptional": true }, "node_modules/json-parse-better-errors": { "version": "1.0.2", @@ -5499,7 +5507,6 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "devOptional": true, - "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -8739,7 +8746,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -8978,7 +8985,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -9206,7 +9213,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -9656,7 +9663,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -9668,7 +9675,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "deprecated": "Rimraf versions prior to v4 are no longer supported", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -9684,7 +9691,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -14128,7 +14135,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -14141,7 +14148,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -14185,7 +14192,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "devOptional": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -14309,13 +14315,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "devOptional": true, - "license": "MIT" - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -14875,7 +14874,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/xtend": { diff --git a/package.json b/package.json index d8725e2..2931a4a 100644 --- a/package.json +++ b/package.json @@ -30,14 +30,14 @@ }, "peerDependencies": { "@babel/eslint-parser": "^7.11.0", - "eslint": "^8.0.0" + "eslint": "^9.23.0" }, "devDependencies": { "@babel/eslint-parser": "7.26.10", "@commitlint/cli": "19.8.0", "@commitlint/config-conventional": "19.8.0", "@commitlint/types": "19.8.0", - "eslint": "8.57.1", + "eslint": "9.23.0", "husky": "8.0.3", "scratch-semantic-release-config": "3.0.0", "semantic-release": "24.2.3" From 5ab252526a5deb40a671b8663286769d14ecc717 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Mar 2025 07:54:09 -0700 Subject: [PATCH 2/6] refactor!: convert to flat config format required by eslint@^9 --- README.md | 54 +++++---- eslint.config.mjs | 3 + index.js | 145 ----------------------- index.mjs | 164 ++++++++++++++++++++++++++ node.js => node.mjs | 16 ++- package-lock.json | 265 ++++++++++++++++++++++++++---------------- package.json | 11 +- react.js => react.mjs | 39 +++++-- es6.js => web.mjs | 24 ++-- 9 files changed, 423 insertions(+), 298 deletions(-) create mode 100644 eslint.config.mjs delete mode 100644 index.js create mode 100644 index.mjs rename node.js => node.mjs (58%) rename react.js => react.mjs (77%) rename es6.js => web.mjs (81%) diff --git a/README.md b/README.md index 054f8e1..47aec2a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Install the config along with its peer dependencies, eslint and babel-eslint. ```bash -npm install -DE eslint-config-scratch eslint@^8 @babel/eslint-parser@^7 +npm install -DE eslint-config-scratch eslint@^9 @babel/eslint-parser@^7 ``` If you're using the React config, also install the dependency for that @@ -20,41 +20,49 @@ npm install -DE eslint-plugin-react@^7 The configuration is split up into several modules: -* `scratch`: The base configuration. Always extend this. -* `scratch/node`: Rules for node, e.g., server-side code, tests, and scripts -* `scratch/es6`: Rules for ES6, for use when you're transpiling with webpack -* `scratch/react`: Rules for React projects +* `eslint-config-scratch`: The base configuration, not configured for any particular environment +* `eslint-config-scratch/node`: Rules for targeting Node.js with ESM +* `eslint-config-scratch/web`: Rules for targeting Scratch's supported web browsers +* `eslint-config-scratch/react`: Rules for targeting Scratch's supported web browsers with React -Usually web projects have a mix of node and web environment files. To lint both -with the appropriate rules, set up a base `.eslintrc.js` with the rules for node -and then override the node configuration in `src` (where web code usually lives). -E.g., with a file structure like this: +These configurations are set up for the flat config format required as of `eslint@^9`. + +Usually web projects contain some files targeting Node.js, for example configuration files, and some targeting web +browsers. To lint both with the appropriate rules, set up a base `eslint.config.mjs` with the rules for Node.js and +then override that configuration in `src` (or wherever your web code lives). + +Your file structure might look like this: ```raw scratch-project -- .eslintrc.js +- eslint.config.mjs - package.json - src - - .eslintrc.js + - eslint.config.mjs - index.js ``` Your config files should be set up like ```javascript -// scratch-project/.eslintrc.js -module.exports = { - extends: ['scratch', 'scratch/es6', 'scratch/node'] -}; - -// scratch-project/src/.eslintrc.js -module.exports = { - root: true, - extends: ['scratch', 'scratch/es6', 'scratch/react'], - env: { - browser: true +// scratch-project/eslint.config.mjs +import nodeConfig from 'eslint-config-scratch/node'; +export default nodeConfig; +``` + +```javascript +// scratch-project/src/eslint.config.mjs +import webConfig from 'eslint-config-scratch/web'; + +export default [ + webConfig, + // If you need to add or override settings: + { + rules: { + // ... + } } -}; +]; ``` This will set up all the files in the project for linting as Node.js by default, diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..406cf95 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,3 @@ +import defaults from './index.mjs'; + +export default defaults; diff --git a/index.js b/index.js deleted file mode 100644 index 1764139..0000000 --- a/index.js +++ /dev/null @@ -1,145 +0,0 @@ -module.exports = { - parser: '@babel/eslint-parser', - parserOptions: { - requireConfigFile: false - }, - rules: { - // Errors - 'valid-jsdoc': [2, { - prefer: { - arg: 'param', - argument: 'param', - class: 'constructor', - return: 'return', - virtual: 'abstract' - }, - preferType: { - Boolean: 'boolean', - Number: 'number', - Object: 'object', - String: 'string' - }, - requireReturn: false, - requireReturnType: true, - requireParamDescription: true, - requireReturnDescription: true - }], - - // Best practices - 'array-callback-return': [2], - 'block-scoped-var': [2], - 'curly': [2, 'multi-line'], - 'dot-location': [2, 'property'], - 'dot-notation': [2], - 'eqeqeq': [2], - 'no-alert': [2], - 'no-div-regex': [2], - 'no-else-return': [2], - 'no-eq-null': [2], - 'no-eval': [2], - 'no-extend-native': [2], - 'no-extra-bind': [2], - 'no-global-assign': [2], - 'no-implied-eval': [2], - 'no-invalid-this': [2], - 'no-iterator': [2], - 'no-lone-blocks': [2], - 'no-loop-func': [2], - 'no-multi-spaces': [2], - 'no-multi-str': [2], - 'no-new': [2], - 'no-proto': [2], - 'no-return-assign': [2], - 'no-script-url': [2], - 'no-self-compare': [2], - 'no-sequences': [2], - 'no-throw-literal': [2], - 'no-unmodified-loop-condition': [2], - 'no-unused-expressions': [2], - 'no-useless-call': [2], - 'no-useless-concat': [2], - 'no-useless-escape': [2], - 'no-warning-comments': [0], - 'no-with': [2], - 'radix': [2], - 'wrap-iife': [2], - 'yoda': [2], - - // Variables - 'no-unused-vars': [2, {args: 'after-used', varsIgnorePattern: '^_'}], - 'no-catch-shadow': [2], - 'no-shadow': [2], - 'no-undefined': [2], - 'no-use-before-define': [2], - - // Strict - 'strict': [2, 'never'], - - // Style - 'array-bracket-spacing': [2, 'never'], - 'block-spacing': [2, 'always'], - 'brace-style': [2], - 'camelcase': [2, { - properties: 'never' - }], - 'comma-dangle': [2, 'never'], - 'comma-spacing': [2], - 'comma-style': [2], - 'eol-last': [2, 'always'], - 'func-call-spacing': [2, 'never'], - 'func-style': [2, 'expression'], - 'indent': [2, 4], - 'jsx-quotes': [2, 'prefer-double'], - 'key-spacing': [2, { - beforeColon: false, - afterColon: true, - mode: 'strict' - }], - 'keyword-spacing': [2, { - before: true, - after: true - }], - 'linebreak-style': [2, 'unix'], - 'max-len': [2, { - code: 120, - tabWidth: 4, - ignoreUrls: true - }], - 'new-parens': [2], - 'newline-per-chained-call': [2], - 'no-lonely-if': [2], - 'no-mixed-operators': [2], - 'no-multiple-empty-lines': [2, { - max: 2, - maxBOF: 0, - maxEOF: 0 - }], - 'no-negated-condition': [2], - 'no-tabs': [2], - 'no-trailing-spaces': [2, {skipBlankLines: true}], - 'no-unneeded-ternary': [2], - 'object-curly-spacing': [2], - 'object-property-newline': [2, { - allowMultiplePropertiesPerLine: true - }], - 'one-var': [2, 'never'], - 'operator-linebreak': [2, 'after'], - 'quote-props': [2, 'consistent-as-needed'], - 'quotes': [2, 'single', { - allowTemplateLiterals: true, - avoidEscape: true - }], - 'require-jsdoc': [2], - 'semi': [2, 'always'], - 'semi-spacing': [2], - 'space-before-function-paren': [2, 'always'], - 'space-in-parens': [2], - 'space-infix-ops': [2], - 'space-unary-ops': [2], - 'spaced-comment': [2] - }, - env: { - commonjs: true - }, - extends: ['eslint:recommended'] -}; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..5c6951e --- /dev/null +++ b/index.mjs @@ -0,0 +1,164 @@ +import globals from 'globals'; +import babelParser from '@babel/eslint-parser'; +import path from 'node:path'; +import {fileURLToPath} from 'node:url'; +import js from '@eslint/js'; +import {FlatCompat} from '@eslint/eslintrc'; +import jsdoc from 'eslint-plugin-jsdoc'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [ + ...compat.extends('eslint:recommended'), + jsdoc.configs['flat/recommended'], + { + languageOptions: { + globals: { + ...globals.commonjs + }, + + parser: babelParser, + ecmaVersion: 6, + sourceType: 'script', + + parserOptions: { + requireConfigFile: false + } + }, + + rules: { + 'array-callback-return': [2], + 'block-scoped-var': [2], + 'curly': [2, 'multi-line'], + 'dot-location': [2, 'property'], + 'dot-notation': [2], + 'eqeqeq': [2], + 'no-alert': [2], + 'no-div-regex': [2], + 'no-else-return': [2], + 'no-eq-null': [2], + 'no-eval': [2], + 'no-extend-native': [2], + 'no-extra-bind': [2], + 'no-global-assign': [2], + 'no-implied-eval': [2], + 'no-invalid-this': [2], + 'no-iterator': [2], + 'no-lone-blocks': [2], + 'no-loop-func': [2], + 'no-multi-spaces': [2], + 'no-multi-str': [2], + 'no-new': [2], + 'no-proto': [2], + 'no-return-assign': [2], + 'no-script-url': [2], + 'no-self-compare': [2], + 'no-sequences': [2], + 'no-throw-literal': [2], + 'no-unmodified-loop-condition': [2], + 'no-unused-expressions': [2], + 'no-useless-call': [2], + 'no-useless-concat': [2], + 'no-useless-escape': [2], + 'no-warning-comments': [0], + 'no-with': [2], + 'radix': [2], + 'wrap-iife': [2], + 'yoda': [2], + + 'no-unused-vars': [2, { + args: 'after-used', + varsIgnorePattern: '^_' + }], + + 'no-catch-shadow': [2], + 'no-shadow': [2], + 'no-undefined': [2], + 'no-use-before-define': [2], + 'strict': [2, 'never'], + 'array-bracket-spacing': [2, 'never'], + 'block-spacing': [2, 'always'], + 'brace-style': [2], + + 'camelcase': [2, { + properties: 'never' + }], + + 'comma-dangle': [2, 'never'], + 'comma-spacing': [2], + 'comma-style': [2], + 'eol-last': [2, 'always'], + 'func-call-spacing': [2, 'never'], + 'func-style': [2, 'expression'], + 'indent': [2, 4], + 'jsx-quotes': [2, 'prefer-double'], + + 'key-spacing': [2, { + beforeColon: false, + afterColon: true, + mode: 'strict' + }], + + 'keyword-spacing': [2, { + before: true, + after: true + }], + + 'linebreak-style': [2, 'unix'], + + 'max-len': [2, { + code: 120, + tabWidth: 4, + ignoreUrls: true + }], + + 'new-parens': [2], + 'newline-per-chained-call': [2], + 'no-lonely-if': [2], + 'no-mixed-operators': [2], + + 'no-multiple-empty-lines': [2, { + max: 2, + maxBOF: 0, + maxEOF: 0 + }], + + 'no-negated-condition': [2], + 'no-tabs': [2], + + 'no-trailing-spaces': [2, { + skipBlankLines: true + }], + + 'no-unneeded-ternary': [2], + 'object-curly-spacing': [2], + + 'object-property-newline': [2, { + allowMultiplePropertiesPerLine: true + }], + + 'one-var': [2, 'never'], + 'operator-linebreak': [2, 'after'], + 'quote-props': [2, 'consistent-as-needed'], + + 'quotes': [2, 'single', { + allowTemplateLiterals: true, + avoidEscape: true + }], + + 'semi': [2, 'always'], + 'semi-spacing': [2], + 'space-before-function-paren': [2, 'always'], + 'space-in-parens': [2], + 'space-infix-ops': [2], + 'space-unary-ops': [2], + 'spaced-comment': [2] + } + } +]; diff --git a/node.js b/node.mjs similarity index 58% rename from node.js rename to node.mjs index ad9deab..3632d0e 100644 --- a/node.js +++ b/node.mjs @@ -1,13 +1,17 @@ -module.exports = { +import globals from 'globals'; + +export default [{ + languageOptions: { + globals: { + ...globals.node + } + }, + rules: { - // Node/CommonJS 'global-require': [2], 'handle-callback-err': [2], 'no-mixed-requires': [2], 'no-new-require': [2], 'no-path-concat': [2] - }, - env: { - node: true } -}; +}]; diff --git a/package-lock.json b/package-lock.json index a59f5d0..374c8bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,12 @@ "name": "eslint-config-scratch", "version": "9.0.9", "license": "BSD-3-Clause", + "dependencies": { + "@eslint/eslintrc": "3.3.1", + "@eslint/js": "9.23.0", + "eslint-plugin-jsdoc": "50.6.9", + "globals": "16.0.0" + }, "devDependencies": { "@babel/eslint-parser": "7.26.10", "@commitlint/cli": "19.8.0", @@ -288,6 +294,16 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { "version": "7.27.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", @@ -584,11 +600,23 @@ "node": ">=v18" } }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.49.0.tgz", + "integrity": "sha512-xjZTSFgECpb9Ohuk5yMX5RhUEbfeQcuOp8IF60e+wyzWEF0M5xeSgqsfLtvPEX8BIyOX9saZqzuGPmZ8oWc+5Q==", + "dependencies": { + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~4.1.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.5.1.tgz", "integrity": "sha512-soEIOALTfTK6EjmKMMoLugwaP0rzkad90iIWd1hMO9ARkSAyjfMfkRRhLvD5qH7vvM0Cg72pieUfR6yh6XxC4w==", - "devOptional": true, "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" @@ -607,7 +635,6 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "devOptional": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -620,7 +647,6 @@ "version": "4.12.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", - "devOptional": true, "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -630,7 +656,6 @@ "version": "0.19.2", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", - "devOptional": true, "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", @@ -644,7 +669,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz", "integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==", - "devOptional": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -653,7 +677,6 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", - "devOptional": true, "dependencies": { "@types/json-schema": "^7.0.15" }, @@ -665,7 +688,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", - "devOptional": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -688,7 +710,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "devOptional": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -704,7 +725,6 @@ "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "devOptional": true, "engines": { "node": ">=18" }, @@ -715,14 +735,12 @@ "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "devOptional": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/@eslint/js": { "version": "9.23.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz", "integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==", - "devOptional": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -731,7 +749,6 @@ "version": "2.1.6", "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", - "devOptional": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -740,7 +757,6 @@ "version": "0.2.7", "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", - "devOptional": true, "dependencies": { "@eslint/core": "^0.12.0", "levn": "^0.4.1" @@ -753,7 +769,6 @@ "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", - "devOptional": true, "engines": { "node": ">=18.18.0" } @@ -762,7 +777,6 @@ "version": "0.16.6", "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", - "devOptional": true, "dependencies": { "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" @@ -775,7 +789,6 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", - "devOptional": true, "engines": { "node": ">=18.18" }, @@ -788,7 +801,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "devOptional": true, "license": "Apache-2.0", "engines": { "node": ">=12.22" @@ -802,7 +814,6 @@ "version": "0.4.2", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", - "devOptional": true, "engines": { "node": ">=18.18" }, @@ -1084,6 +1095,17 @@ "@octokit/openapi-types": "^18.0.0" } }, + "node_modules/@pkgr/core": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.2.tgz", + "integrity": "sha512-fdDH1LSGfZdTH2sxdpVMw31BanV28K/Gry0cVFxaNP77neJSkd82mM8ErPNYs9e+0O7SdHBLTDzDgwUuy18RnQ==", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", @@ -1735,14 +1757,12 @@ "node_modules/@types/estree": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", - "devOptional": true + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==" }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "devOptional": true + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" }, "node_modules/@types/minimist": { "version": "1.2.5", @@ -1772,7 +1792,6 @@ "version": "8.14.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", - "devOptional": true, "bin": { "acorn": "bin/acorn" }, @@ -1784,7 +1803,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "devOptional": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -1863,7 +1881,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -1882,11 +1899,18 @@ "dev": true, "license": "MIT" }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "devOptional": true, "license": "Python-2.0" }, "node_modules/argv-formatter": { @@ -2089,7 +2113,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "devOptional": true, "license": "MIT" }, "node_modules/before-after-hook": { @@ -2110,7 +2133,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "devOptional": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -2218,7 +2240,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=6" @@ -2422,7 +2443,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -2435,9 +2455,16 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true, "license": "MIT" }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -2453,7 +2480,6 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "devOptional": true, "license": "MIT" }, "node_modules/config-chain": { @@ -2745,7 +2771,6 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "devOptional": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -2847,7 +2872,6 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "devOptional": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -2912,7 +2936,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "devOptional": true, "license": "MIT" }, "node_modules/define-data-property": { @@ -3375,6 +3398,11 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", + "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==" + }, "node_modules/es-object-atoms": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", @@ -3449,7 +3477,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -3462,7 +3489,6 @@ "version": "9.23.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", "integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==", - "devOptional": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -3518,6 +3544,50 @@ } } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "50.6.9", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.9.tgz", + "integrity": "sha512-7/nHu3FWD4QRG8tCVqcv+BfFtctUtEDWc29oeDXB4bwmDM2/r1ndl14AG/2DUntdqH7qmpvdemJKwb3R97/QEw==", + "dependencies": { + "@es-joy/jsdoccomment": "~0.49.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.6", + "escape-string-regexp": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.6.0", + "parse-imports": "^2.1.1", + "semver": "^7.6.3", + "spdx-expression-parse": "^4.0.0", + "synckit": "^0.9.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-jsdoc/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==", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/eslint-plugin-react": { "version": "7.37.4", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.4.tgz", @@ -3602,7 +3672,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "devOptional": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -3619,7 +3688,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -3636,7 +3704,6 @@ "version": "8.3.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", - "devOptional": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -3652,7 +3719,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "devOptional": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3664,7 +3730,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "devOptional": true, "license": "MIT", "dependencies": { "locate-path": "^6.0.0", @@ -3681,14 +3746,12 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "devOptional": true, "license": "MIT" }, "node_modules/eslint/node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "devOptional": true, "license": "MIT", "dependencies": { "p-locate": "^5.0.0" @@ -3704,7 +3767,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "devOptional": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -3720,7 +3782,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "devOptional": true, "license": "MIT", "dependencies": { "p-limit": "^3.0.2" @@ -3736,7 +3797,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -3746,7 +3806,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -3759,7 +3818,6 @@ "version": "10.3.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", - "devOptional": true, "dependencies": { "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", @@ -3776,7 +3834,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "devOptional": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3788,7 +3845,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "devOptional": true, "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" @@ -3801,7 +3857,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "devOptional": true, "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" @@ -3814,7 +3869,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "devOptional": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -3824,7 +3878,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "devOptional": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -3875,7 +3928,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "devOptional": true, "license": "MIT" }, "node_modules/fast-glob": { @@ -3912,14 +3964,12 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "devOptional": true, "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "devOptional": true, "license": "MIT" }, "node_modules/fast-uri": { @@ -3969,7 +4019,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "devOptional": true, "dependencies": { "flat-cache": "^4.0.0" }, @@ -4042,7 +4091,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "devOptional": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -4054,8 +4102,7 @@ "node_modules/flatted": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "devOptional": true + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==" }, "node_modules/for-each": { "version": "0.3.5", @@ -4331,7 +4378,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "devOptional": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.3" @@ -4357,14 +4403,14 @@ } }, "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "license": "MIT", - "peer": true, + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz", + "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==", "engines": { - "node": ">=4" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { @@ -4474,7 +4520,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -4639,7 +4684,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "devOptional": true, "license": "MIT", "engines": { "node": ">= 4" @@ -4649,7 +4693,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", - "devOptional": true, "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -4666,7 +4709,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=4" @@ -4714,7 +4756,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -4950,7 +4991,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -5005,7 +5045,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "devOptional": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -5299,7 +5338,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "devOptional": true, "license": "ISC" }, "node_modules/issue-parser": { @@ -5368,7 +5406,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "devOptional": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -5377,6 +5414,14 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", + "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", @@ -5394,8 +5439,7 @@ "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==", - "devOptional": true + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, "node_modules/json-parse-better-errors": { "version": "1.0.2", @@ -5422,7 +5466,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "devOptional": true, "license": "MIT" }, "node_modules/json-stringify-safe": { @@ -5506,7 +5549,6 @@ "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "devOptional": true, "dependencies": { "json-buffer": "3.0.1" } @@ -5525,7 +5567,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "devOptional": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", @@ -5655,7 +5696,6 @@ "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "devOptional": true, "license": "MIT" }, "node_modules/lodash.mergewith": { @@ -5863,7 +5903,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "devOptional": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -5911,7 +5950,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "devOptional": true, "license": "MIT" }, "node_modules/mz": { @@ -5930,7 +5968,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "devOptional": true, "license": "MIT" }, "node_modules/neo-async": { @@ -8772,7 +8809,6 @@ "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "devOptional": true, "license": "MIT", "dependencies": { "deep-is": "^0.1.3", @@ -8906,7 +8942,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "devOptional": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -8915,6 +8950,18 @@ "node": ">=6" } }, + "node_modules/parse-imports": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.2.1.tgz", + "integrity": "sha512-OL/zLggRp8mFhKL0rNORUTR4yBYujK/uU+xZL+/0Rgm2QE4nLO9v8PzEweSJEbMGKmDRjJE4R3IMJlL2di4JeQ==", + "dependencies": { + "es-module-lexer": "^1.5.3", + "slashes": "^3.0.12" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -8995,7 +9042,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -9139,7 +9185,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -9191,7 +9236,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=6" @@ -13690,7 +13734,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "devOptional": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -13703,7 +13746,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -13921,6 +13963,11 @@ "node": ">=8" } }, + "node_modules/slashes": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz", + "integrity": "sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==" + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -13953,7 +14000,6 @@ "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": { @@ -13971,7 +14017,6 @@ "version": "3.0.21", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", - "dev": true, "license": "CC0-1.0" }, "node_modules/split": { @@ -14191,7 +14236,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "devOptional": true, "engines": { "node": ">=8" }, @@ -14220,7 +14264,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -14259,6 +14302,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -14436,11 +14494,15 @@ "node": ">=8" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "devOptional": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" @@ -14681,7 +14743,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "devOptional": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -14734,7 +14795,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "devOptional": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -14839,7 +14899,6 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=0.10.0" diff --git a/package.json b/package.json index 2931a4a..fced004 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,11 @@ "name": "eslint-config-scratch", "version": "9.0.9", "description": "Shareable ESLint config for Scratch", - "main": "index.js", + "main": "index.mjs", "scripts": { "prepare": "husky install", "test": "eslint ." }, - "eslintConfig": { - "extends": "./index.js" - }, "repository": { "type": "git", "url": "https://github.com/scratchfoundation/eslint-config-scratch.git" @@ -46,5 +43,11 @@ "commitizen": { "path": "cz-conventional-changelog" } + }, + "dependencies": { + "@eslint/eslintrc": "3.3.1", + "@eslint/js": "9.23.0", + "eslint-plugin-jsdoc": "50.6.9", + "globals": "16.0.0" } } diff --git a/react.js b/react.mjs similarity index 77% rename from react.js rename to react.mjs index 89d5e55..c2f7106 100644 --- a/react.js +++ b/react.mjs @@ -1,4 +1,22 @@ -module.exports = { +import react from 'eslint-plugin-react'; +import path from 'node:path'; +import {fileURLToPath} from 'node:url'; +import js from '@eslint/js'; +import {FlatCompat} from '@eslint/eslintrc'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends('plugin:react/recommended'), { + plugins: { + react + }, + rules: { 'react/display-name': [2], 'react/forbid-prop-types': [2], @@ -11,9 +29,11 @@ module.exports = { 'react/no-direct-mutation-state': [2], 'react/no-find-dom-node': [2], 'react/no-is-mounted': [2], + 'react/no-multi-comp': [2, { ignoreStateless: true }], + 'react/no-render-return-value': [2], 'react/no-set-state': [0], 'react/no-string-refs': [2], @@ -29,8 +49,6 @@ module.exports = { 'react/self-closing-comp': [2], 'react/sort-comp': [2], 'react/style-prop-object': [2], - - // JSX 'react/jsx-boolean-value': [2, 'never'], 'react/jsx-closing-bracket-location': [2, 'line-aligned'], 'react/jsx-curly-spacing': [2], @@ -41,22 +59,27 @@ module.exports = { 'react/jsx-indent': [2], 'react/jsx-indent-props': [2], 'react/jsx-key': [2], - 'react/jsx-max-props-per-line': [2, {maximum: 1}], + + 'react/jsx-max-props-per-line': [2, { + maximum: 1 + }], + 'react/jsx-no-bind': [2, { ignoreRefs: true }], + 'react/jsx-no-comment-textnodes': [2], 'react/jsx-no-duplicate-props': [2], 'react/jsx-no-target-blank': [2], 'react/jsx-no-undef': [2], + 'react/jsx-pascal-case': [2, { allowAllCaps: true }], + 'react/jsx-tag-spacing': [2], 'react/jsx-uses-react': [2], 'react/jsx-uses-vars': [2], 'react/jsx-wrap-multilines': [2] - }, - plugins: ['react'], - extends: ['plugin:react/recommended'] -}; + } +}]; diff --git a/es6.js b/web.mjs similarity index 81% rename from es6.js rename to web.mjs index a1c78ad..28750f0 100644 --- a/es6.js +++ b/web.mjs @@ -1,11 +1,19 @@ -module.exports = { +export default [{ + languageOptions: { + globals: {}, + ecmaVersion: 2018, + sourceType: 'script' + }, + rules: { 'arrow-body-style': [2, 'as-needed'], 'arrow-parens': [2, 'as-needed'], + 'arrow-spacing': [2, { before: true, after: true }], + 'no-prototype-builtins': [2], 'no-confusing-arrow': [2], 'no-duplicate-imports': [2], @@ -16,7 +24,11 @@ module.exports = { 'no-useless-rename': [2], 'no-var': [2], 'prefer-arrow-callback': [2], - 'prefer-const': [2, {destructuring: 'all'}], + + 'prefer-const': [2, { + destructuring: 'all' + }], + 'prefer-promise-reject-errors': [2], 'prefer-rest-params': [2], 'prefer-spread': [2], @@ -26,11 +38,5 @@ module.exports = { 'rest-spread-spacing': [2, 'never'], 'symbol-description': [2], 'template-curly-spacing': [2, 'never'] - }, - env: { - es6: true - }, - parserOptions: { - ecmaVersion: 2018 } -}; +}]; From b3d5b5259992c71774993b350ee4a705d64a815f Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Mar 2025 14:47:07 -0700 Subject: [PATCH 3/6] feat!: implement new configurations based on ESLint Stylistic The previous configurations are still available under `lib/legacy/*`, exported as `legacy` and `legacy/*`. --- .editorconfig | 12 ++ README.md | 58 +++++-- eslint.config.mjs | 2 +- lib/index.mjs | 8 + web.mjs => lib/legacy/es6.mjs | 0 index.mjs => lib/legacy/index.mjs | 0 node.mjs => lib/legacy/node.mjs | 0 react.mjs => lib/legacy/react.mjs | 0 lib/node.mjs | 15 ++ lib/react.mjs | 15 ++ lib/shared/makeConfig.mjs | 30 ++++ lib/web.mjs | 15 ++ package-lock.json | 204 ++++++++++++++++++++++-- package.json | 13 +- release.config.js => release.config.cjs | 0 15 files changed, 344 insertions(+), 28 deletions(-) create mode 100644 .editorconfig create mode 100644 lib/index.mjs rename web.mjs => lib/legacy/es6.mjs (100%) rename index.mjs => lib/legacy/index.mjs (100%) rename node.mjs => lib/legacy/node.mjs (100%) rename react.mjs => lib/legacy/react.mjs (100%) create mode 100644 lib/node.mjs create mode 100644 lib/react.mjs create mode 100644 lib/shared/makeConfig.mjs create mode 100644 lib/web.mjs rename release.config.js => release.config.cjs (100%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..be6af50 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +max_line_length = 118 +trim_trailing_whitespace = true + +[*.{cjs,js,jsx,mjs,ts,tsx}] +indent_size = 2 +indent_style = space diff --git a/README.md b/README.md index 47aec2a..cb75b3c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Scratch ESLint config -`eslint-config-scratch` defines the eslint rules used for Scratch Javascript projects. +`eslint-config-scratch` defines the eslint rules used for Scratch Javascript and TypeScript projects. The rules are +based on the [ESLint Stylistic project](https://eslint.style/). ## Installation @@ -18,14 +19,16 @@ npm install -DE eslint-plugin-react@^7 ## Usage -The configuration is split up into several modules: +### Common configurations + +There are several pre-made configurations available: * `eslint-config-scratch`: The base configuration, not configured for any particular environment * `eslint-config-scratch/node`: Rules for targeting Node.js with ESM * `eslint-config-scratch/web`: Rules for targeting Scratch's supported web browsers * `eslint-config-scratch/react`: Rules for targeting Scratch's supported web browsers with React -These configurations are set up for the flat config format required as of `eslint@^9`. +All configurations in this repository are set up for the flat config format required as of `eslint@^9`. Usually web projects contain some files targeting Node.js, for example configuration files, and some targeting web browsers. To lint both with the appropriate rules, set up a base `eslint.config.mjs` with the rules for Node.js and @@ -52,10 +55,11 @@ export default nodeConfig; ```javascript // scratch-project/src/eslint.config.mjs -import webConfig from 'eslint-config-scratch/web'; +import reactConfig from 'eslint-config-scratch/react'; +/** @type {import('eslint').Linter.Config[]} */ export default [ - webConfig, + reactConfig, // If you need to add or override settings: { rules: { @@ -65,17 +69,53 @@ export default [ ]; ``` -This will set up all the files in the project for linting as Node.js by default, -except for those in `src/`, which will be linted as ES6 and React files. +This will set up all the files in the project for linting as Node.js by default, except for those in `src/`, which +will be linted React files targeting web browsers. -If you're linting React, also make sure your lint script lints `.jsx` files: +In most cases, you won't need to specify the file names or extensions that `eslint` should check. You can probably +just use this: ```json "scripts": { - "lint": "eslint . --ext .js,.jsx" + "lint": "eslint" } ``` +### Custom configurations + +If you need to set up a custom configuration, you can use the `makeConfig` function to create a basic configuration +object and customize it as needed. + +```javascript +// scratch-project/eslint.config.mjs +import {makeConfig} from 'eslint-config-scratch'; +import globals from 'globals'; + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + ...makeConfig({ + jsx: true, + }), + { + languageOptions: { + globals: globals.worker, + }, + } +] +``` + +## Legacy Styles + +Scratch used very different styling rules in `eslint-config-scratch@^9` and below. If you need to use those rules, you +can use the rule sets under `legacy/`: + +* `eslint-config-scratch/legacy`: Legacy base configuration, not configured for any particular environment +* `eslint-config-scratch/legacy/es6`: Legacy rules for targeting Scratch's supported web browsers +* `eslint-config-scratch/legacy/node`: Legacy rules for targeting Node.js +* `eslint-config-scratch/legacy/react`: Legacy rules for targeting Scratch's supported web browsers with React + +New projects should not use these rule sets. They may disappear in the future. + ## Committing This project uses [semantic release](https://github.com/semantic-release/semantic-release) diff --git a/eslint.config.mjs b/eslint.config.mjs index 406cf95..f8a50e4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,3 +1,3 @@ -import defaults from './index.mjs'; +import defaults from './lib/index.mjs'; export default defaults; diff --git a/lib/index.mjs b/lib/index.mjs new file mode 100644 index 0000000..42724e6 --- /dev/null +++ b/lib/index.mjs @@ -0,0 +1,8 @@ +import { makeConfig } from "./shared/makeConfig.mjs"; + +/** + * @type {import('eslint').Linter.Config[]} + */ +export default makeConfig(); + +export { makeConfig }; diff --git a/web.mjs b/lib/legacy/es6.mjs similarity index 100% rename from web.mjs rename to lib/legacy/es6.mjs diff --git a/index.mjs b/lib/legacy/index.mjs similarity index 100% rename from index.mjs rename to lib/legacy/index.mjs diff --git a/node.mjs b/lib/legacy/node.mjs similarity index 100% rename from node.mjs rename to lib/legacy/node.mjs diff --git a/react.mjs b/lib/legacy/react.mjs similarity index 100% rename from react.mjs rename to lib/legacy/react.mjs diff --git a/lib/node.mjs b/lib/node.mjs new file mode 100644 index 0000000..f94d5d8 --- /dev/null +++ b/lib/node.mjs @@ -0,0 +1,15 @@ +import globals from 'globals' + +import { makeConfig } from './shared/makeConfig.mjs' + +/** + * @type {import('eslint').Linter.Config[]} + */ +export default [ + ...makeConfig(), + { + languageOptions: { + globals: globals.node, + }, + }, +] diff --git a/lib/react.mjs b/lib/react.mjs new file mode 100644 index 0000000..8717da3 --- /dev/null +++ b/lib/react.mjs @@ -0,0 +1,15 @@ +import globals from 'globals' + +import { makeConfig } from './shared/makeConfig.mjs' + +/** + * @type {import('eslint').Linter.Config[]} + */ +export default [ + ...makeConfig({ enableReact: true }), + { + languageOptions: { + globals: globals.node, + }, + }, +] diff --git a/lib/shared/makeConfig.mjs b/lib/shared/makeConfig.mjs new file mode 100644 index 0000000..2dacb37 --- /dev/null +++ b/lib/shared/makeConfig.mjs @@ -0,0 +1,30 @@ +import jsdoc from 'eslint-plugin-jsdoc'; +import stylistic from '@stylistic/eslint-plugin'; + +/** + * @typedef {import('eslint').Linter.Config} ESLintConfig + */ + +/** + * @param {Object} options + * @param {boolean} [options.enableReact] Enable React JSX rules. + * @returns {ESLintConfig[]} ESLint configurations. + */ +const makeConfig = ({ + enableReact, +} = {}) => [ + stylistic.configs.customize({ + jsx: enableReact, + }), + jsdoc.configs['flat/recommended'], + { + plugins: { + jsdoc + }, + rules: { + '@stylistic/max-len': ['error', 118], // above 118 doesn't display well in GitHub's 120-column diff views + } + } +]; + +export {makeConfig}; diff --git a/lib/web.mjs b/lib/web.mjs new file mode 100644 index 0000000..b069fda --- /dev/null +++ b/lib/web.mjs @@ -0,0 +1,15 @@ +import globals from 'globals' + +import { makeConfig } from './shared/makeConfig.mjs' + +/** + * @type {import('eslint').Linter.Config[]} + */ +export default [ + ...makeConfig(), + { + languageOptions: { + globals: globals.browser, + }, + }, +] diff --git a/package-lock.json b/package-lock.json index 374c8bb..63a7096 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@eslint/eslintrc": "3.3.1", "@eslint/js": "9.23.0", + "@stylistic/eslint-plugin": "4.2.0", "eslint-plugin-jsdoc": "50.6.9", "globals": "16.0.0" }, @@ -894,7 +895,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -908,7 +908,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -918,7 +917,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -1744,6 +1742,46 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@stylistic/eslint-plugin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-4.2.0.tgz", + "integrity": "sha512-8hXezgz7jexGHdo5WN6JBEIPHCSFyyU4vgbxevu4YLVS5vl+sxqAAGyXSzfNDyR6xMNSH5H1x67nsXcYMOHtZA==", + "dependencies": { + "@typescript-eslint/utils": "^8.23.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=9.0.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@types/conventional-commits-parser": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@types/conventional-commits-parser/-/conventional-commits-parser-5.0.1.tgz", @@ -1788,6 +1826,141 @@ "dev": true, "license": "MIT" }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.28.0.tgz", + "integrity": "sha512-u2oITX3BJwzWCapoZ/pXw6BCOl8rJP4Ij/3wPoGvY8XwvXflOzd1kLrDUUUAIEdJSFh+ASwdTHqtan9xSg8buw==", + "dependencies": { + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.28.0.tgz", + "integrity": "sha512-bn4WS1bkKEjx7HqiwG2JNB3YJdC1q6Ue7GyGlwPHyt0TnVq6TtD/hiOdTZt71sq0s7UzqBFXD8t8o2e63tXgwA==", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.28.0.tgz", + "integrity": "sha512-H74nHEeBGeklctAVUvmDkxB1mk+PAZ9FiOMPFncdqeRBXxk1lWSYraHw8V12b7aa6Sg9HOBNbGdSHobBPuQSuA==", + "dependencies": { + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.28.0.tgz", + "integrity": "sha512-OELa9hbTYciYITqgurT1u/SzpQVtDLmQMFzy/N8pQE+tefOyCWT79jHsav294aTqV1q1u+VzqDGbuujvRYaeSQ==", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.28.0", + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/typescript-estree": "8.28.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.28.0.tgz", + "integrity": "sha512-hbn8SZ8w4u2pRwgQ1GlUrPKE+t2XvcCW5tTRF7j6SMYIuYG37XuzIW44JCZPa36evi0Oy2SnM664BlIaAuQcvg==", + "dependencies": { + "@typescript-eslint/types": "8.28.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/acorn": { "version": "8.14.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", @@ -2143,7 +2316,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -3934,7 +4106,6 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3951,7 +4122,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -3993,7 +4163,6 @@ "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", - "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -4030,7 +4199,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -5070,7 +5238,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" @@ -5846,7 +6013,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -5856,7 +6022,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -9075,7 +9240,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "license": "MIT", "engines": { "node": ">=8.6" @@ -9257,7 +9421,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -9707,7 +9870,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -9735,7 +9897,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -14455,7 +14616,6 @@ "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, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -14494,6 +14654,17 @@ "node": ">=8" } }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -14603,7 +14774,6 @@ "version": "5.8.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", - "dev": true, "license": "Apache-2.0", "peer": true, "bin": { diff --git a/package.json b/package.json index fced004..461a979 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,20 @@ "name": "eslint-config-scratch", "version": "9.0.9", "description": "Shareable ESLint config for Scratch", + "exports": { + ".": "./lib/index.mjs", + "node": "./lib/node.mjs", + "react": "./lib/react.mjs", + "web": "./lib/web.mjs", + "legacy": "./lib/legacy/index.mjs", + "legacy/es6": "./lib/legacy/es6.mjs", + "legacy/node": "./lib/legacy/node.mjs", + "legacy/react": "./lib/legacy/react.mjs" + }, "main": "index.mjs", "scripts": { "prepare": "husky install", - "test": "eslint ." + "test": "eslint" }, "repository": { "type": "git", @@ -47,6 +57,7 @@ "dependencies": { "@eslint/eslintrc": "3.3.1", "@eslint/js": "9.23.0", + "@stylistic/eslint-plugin": "4.2.0", "eslint-plugin-jsdoc": "50.6.9", "globals": "16.0.0" } diff --git a/release.config.js b/release.config.cjs similarity index 100% rename from release.config.js rename to release.config.cjs From 96ac0fba2ef4459ed1e39f2288103ffac012e8d4 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Mar 2025 14:50:14 -0700 Subject: [PATCH 4/6] style: apply new lint rules to this repo --- commitlint.config.mjs | 6 +- eslint.config.mjs | 4 +- lib/index.mjs | 6 +- lib/legacy/es6.mjs | 72 ++++----- lib/legacy/index.mjs | 322 +++++++++++++++++++------------------- lib/legacy/node.mjs | 26 +-- lib/legacy/react.mjs | 146 ++++++++--------- lib/shared/makeConfig.mjs | 36 ++--- release.config.cjs | 16 +- 9 files changed, 317 insertions(+), 317 deletions(-) diff --git a/commitlint.config.mjs b/commitlint.config.mjs index e9c229e..1cfe5d4 100644 --- a/commitlint.config.mjs +++ b/commitlint.config.mjs @@ -5,6 +5,6 @@ * @type {import('@commitlint/types').UserConfig} */ export default { - extends: ['@commitlint/config-conventional'], - ignores: [message => message.startsWith('chore(release):')] -}; + extends: ['@commitlint/config-conventional'], + ignores: [message => message.startsWith('chore(release):')], +} diff --git a/eslint.config.mjs b/eslint.config.mjs index f8a50e4..0f3a89b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,3 +1,3 @@ -import defaults from './lib/index.mjs'; +import defaults from './lib/index.mjs' -export default defaults; +export default defaults diff --git a/lib/index.mjs b/lib/index.mjs index 42724e6..6ef830e 100644 --- a/lib/index.mjs +++ b/lib/index.mjs @@ -1,8 +1,8 @@ -import { makeConfig } from "./shared/makeConfig.mjs"; +import { makeConfig } from './shared/makeConfig.mjs' /** * @type {import('eslint').Linter.Config[]} */ -export default makeConfig(); +export default makeConfig() -export { makeConfig }; +export { makeConfig } diff --git a/lib/legacy/es6.mjs b/lib/legacy/es6.mjs index 28750f0..de660a2 100644 --- a/lib/legacy/es6.mjs +++ b/lib/legacy/es6.mjs @@ -1,42 +1,42 @@ export default [{ - languageOptions: { - globals: {}, - ecmaVersion: 2018, - sourceType: 'script' - }, + languageOptions: { + globals: {}, + ecmaVersion: 2018, + sourceType: 'script', + }, - rules: { - 'arrow-body-style': [2, 'as-needed'], - 'arrow-parens': [2, 'as-needed'], + rules: { + 'arrow-body-style': [2, 'as-needed'], + 'arrow-parens': [2, 'as-needed'], - 'arrow-spacing': [2, { - before: true, - after: true - }], + 'arrow-spacing': [2, { + before: true, + after: true, + }], - 'no-prototype-builtins': [2], - 'no-confusing-arrow': [2], - 'no-duplicate-imports': [2], - 'no-return-await': [2], - 'no-template-curly-in-string': [2], - 'no-useless-computed-key': [2], - 'no-useless-constructor': [2], - 'no-useless-rename': [2], - 'no-var': [2], - 'prefer-arrow-callback': [2], + 'no-prototype-builtins': [2], + 'no-confusing-arrow': [2], + 'no-duplicate-imports': [2], + 'no-return-await': [2], + 'no-template-curly-in-string': [2], + 'no-useless-computed-key': [2], + 'no-useless-constructor': [2], + 'no-useless-rename': [2], + 'no-var': [2], + 'prefer-arrow-callback': [2], - 'prefer-const': [2, { - destructuring: 'all' - }], + 'prefer-const': [2, { + destructuring: 'all', + }], - 'prefer-promise-reject-errors': [2], - 'prefer-rest-params': [2], - 'prefer-spread': [2], - 'prefer-template': [2], - 'require-atomic-updates': [2], - 'require-await': [2], - 'rest-spread-spacing': [2, 'never'], - 'symbol-description': [2], - 'template-curly-spacing': [2, 'never'] - } -}]; + 'prefer-promise-reject-errors': [2], + 'prefer-rest-params': [2], + 'prefer-spread': [2], + 'prefer-template': [2], + 'require-atomic-updates': [2], + 'require-await': [2], + 'rest-spread-spacing': [2, 'never'], + 'symbol-description': [2], + 'template-curly-spacing': [2, 'never'], + }, +}] diff --git a/lib/legacy/index.mjs b/lib/legacy/index.mjs index 5c6951e..2b75894 100644 --- a/lib/legacy/index.mjs +++ b/lib/legacy/index.mjs @@ -1,164 +1,164 @@ -import globals from 'globals'; -import babelParser from '@babel/eslint-parser'; -import path from 'node:path'; -import {fileURLToPath} from 'node:url'; -import js from '@eslint/js'; -import {FlatCompat} from '@eslint/eslintrc'; -import jsdoc from 'eslint-plugin-jsdoc'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); +import globals from 'globals' +import babelParser from '@babel/eslint-parser' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import js from '@eslint/js' +import { FlatCompat } from '@eslint/eslintrc' +import jsdoc from 'eslint-plugin-jsdoc' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all -}); + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) export default [ - ...compat.extends('eslint:recommended'), - jsdoc.configs['flat/recommended'], - { - languageOptions: { - globals: { - ...globals.commonjs - }, - - parser: babelParser, - ecmaVersion: 6, - sourceType: 'script', - - parserOptions: { - requireConfigFile: false - } - }, - - rules: { - 'array-callback-return': [2], - 'block-scoped-var': [2], - 'curly': [2, 'multi-line'], - 'dot-location': [2, 'property'], - 'dot-notation': [2], - 'eqeqeq': [2], - 'no-alert': [2], - 'no-div-regex': [2], - 'no-else-return': [2], - 'no-eq-null': [2], - 'no-eval': [2], - 'no-extend-native': [2], - 'no-extra-bind': [2], - 'no-global-assign': [2], - 'no-implied-eval': [2], - 'no-invalid-this': [2], - 'no-iterator': [2], - 'no-lone-blocks': [2], - 'no-loop-func': [2], - 'no-multi-spaces': [2], - 'no-multi-str': [2], - 'no-new': [2], - 'no-proto': [2], - 'no-return-assign': [2], - 'no-script-url': [2], - 'no-self-compare': [2], - 'no-sequences': [2], - 'no-throw-literal': [2], - 'no-unmodified-loop-condition': [2], - 'no-unused-expressions': [2], - 'no-useless-call': [2], - 'no-useless-concat': [2], - 'no-useless-escape': [2], - 'no-warning-comments': [0], - 'no-with': [2], - 'radix': [2], - 'wrap-iife': [2], - 'yoda': [2], - - 'no-unused-vars': [2, { - args: 'after-used', - varsIgnorePattern: '^_' - }], - - 'no-catch-shadow': [2], - 'no-shadow': [2], - 'no-undefined': [2], - 'no-use-before-define': [2], - 'strict': [2, 'never'], - 'array-bracket-spacing': [2, 'never'], - 'block-spacing': [2, 'always'], - 'brace-style': [2], - - 'camelcase': [2, { - properties: 'never' - }], - - 'comma-dangle': [2, 'never'], - 'comma-spacing': [2], - 'comma-style': [2], - 'eol-last': [2, 'always'], - 'func-call-spacing': [2, 'never'], - 'func-style': [2, 'expression'], - 'indent': [2, 4], - 'jsx-quotes': [2, 'prefer-double'], - - 'key-spacing': [2, { - beforeColon: false, - afterColon: true, - mode: 'strict' - }], - - 'keyword-spacing': [2, { - before: true, - after: true - }], - - 'linebreak-style': [2, 'unix'], - - 'max-len': [2, { - code: 120, - tabWidth: 4, - ignoreUrls: true - }], - - 'new-parens': [2], - 'newline-per-chained-call': [2], - 'no-lonely-if': [2], - 'no-mixed-operators': [2], - - 'no-multiple-empty-lines': [2, { - max: 2, - maxBOF: 0, - maxEOF: 0 - }], - - 'no-negated-condition': [2], - 'no-tabs': [2], - - 'no-trailing-spaces': [2, { - skipBlankLines: true - }], - - 'no-unneeded-ternary': [2], - 'object-curly-spacing': [2], - - 'object-property-newline': [2, { - allowMultiplePropertiesPerLine: true - }], - - 'one-var': [2, 'never'], - 'operator-linebreak': [2, 'after'], - 'quote-props': [2, 'consistent-as-needed'], - - 'quotes': [2, 'single', { - allowTemplateLiterals: true, - avoidEscape: true - }], - - 'semi': [2, 'always'], - 'semi-spacing': [2], - 'space-before-function-paren': [2, 'always'], - 'space-in-parens': [2], - 'space-infix-ops': [2], - 'space-unary-ops': [2], - 'spaced-comment': [2] - } - } -]; + ...compat.extends('eslint:recommended'), + jsdoc.configs['flat/recommended'], + { + languageOptions: { + globals: { + ...globals.commonjs, + }, + + parser: babelParser, + ecmaVersion: 6, + sourceType: 'script', + + parserOptions: { + requireConfigFile: false, + }, + }, + + rules: { + 'array-callback-return': [2], + 'block-scoped-var': [2], + 'curly': [2, 'multi-line'], + 'dot-location': [2, 'property'], + 'dot-notation': [2], + 'eqeqeq': [2], + 'no-alert': [2], + 'no-div-regex': [2], + 'no-else-return': [2], + 'no-eq-null': [2], + 'no-eval': [2], + 'no-extend-native': [2], + 'no-extra-bind': [2], + 'no-global-assign': [2], + 'no-implied-eval': [2], + 'no-invalid-this': [2], + 'no-iterator': [2], + 'no-lone-blocks': [2], + 'no-loop-func': [2], + 'no-multi-spaces': [2], + 'no-multi-str': [2], + 'no-new': [2], + 'no-proto': [2], + 'no-return-assign': [2], + 'no-script-url': [2], + 'no-self-compare': [2], + 'no-sequences': [2], + 'no-throw-literal': [2], + 'no-unmodified-loop-condition': [2], + 'no-unused-expressions': [2], + 'no-useless-call': [2], + 'no-useless-concat': [2], + 'no-useless-escape': [2], + 'no-warning-comments': [0], + 'no-with': [2], + 'radix': [2], + 'wrap-iife': [2], + 'yoda': [2], + + 'no-unused-vars': [2, { + args: 'after-used', + varsIgnorePattern: '^_', + }], + + 'no-catch-shadow': [2], + 'no-shadow': [2], + 'no-undefined': [2], + 'no-use-before-define': [2], + 'strict': [2, 'never'], + 'array-bracket-spacing': [2, 'never'], + 'block-spacing': [2, 'always'], + 'brace-style': [2], + + 'camelcase': [2, { + properties: 'never', + }], + + 'comma-dangle': [2, 'never'], + 'comma-spacing': [2], + 'comma-style': [2], + 'eol-last': [2, 'always'], + 'func-call-spacing': [2, 'never'], + 'func-style': [2, 'expression'], + 'indent': [2, 4], + 'jsx-quotes': [2, 'prefer-double'], + + 'key-spacing': [2, { + beforeColon: false, + afterColon: true, + mode: 'strict', + }], + + 'keyword-spacing': [2, { + before: true, + after: true, + }], + + 'linebreak-style': [2, 'unix'], + + 'max-len': [2, { + code: 120, + tabWidth: 4, + ignoreUrls: true, + }], + + 'new-parens': [2], + 'newline-per-chained-call': [2], + 'no-lonely-if': [2], + 'no-mixed-operators': [2], + + 'no-multiple-empty-lines': [2, { + max: 2, + maxBOF: 0, + maxEOF: 0, + }], + + 'no-negated-condition': [2], + 'no-tabs': [2], + + 'no-trailing-spaces': [2, { + skipBlankLines: true, + }], + + 'no-unneeded-ternary': [2], + 'object-curly-spacing': [2], + + 'object-property-newline': [2, { + allowMultiplePropertiesPerLine: true, + }], + + 'one-var': [2, 'never'], + 'operator-linebreak': [2, 'after'], + 'quote-props': [2, 'consistent-as-needed'], + + 'quotes': [2, 'single', { + allowTemplateLiterals: true, + avoidEscape: true, + }], + + 'semi': [2, 'always'], + 'semi-spacing': [2], + 'space-before-function-paren': [2, 'always'], + 'space-in-parens': [2], + 'space-infix-ops': [2], + 'space-unary-ops': [2], + 'spaced-comment': [2], + }, + }, +] diff --git a/lib/legacy/node.mjs b/lib/legacy/node.mjs index 3632d0e..7d42804 100644 --- a/lib/legacy/node.mjs +++ b/lib/legacy/node.mjs @@ -1,17 +1,17 @@ -import globals from 'globals'; +import globals from 'globals' export default [{ - languageOptions: { - globals: { - ...globals.node - } + languageOptions: { + globals: { + ...globals.node, }, + }, - rules: { - 'global-require': [2], - 'handle-callback-err': [2], - 'no-mixed-requires': [2], - 'no-new-require': [2], - 'no-path-concat': [2] - } -}]; + rules: { + 'global-require': [2], + 'handle-callback-err': [2], + 'no-mixed-requires': [2], + 'no-new-require': [2], + 'no-path-concat': [2], + }, +}] diff --git a/lib/legacy/react.mjs b/lib/legacy/react.mjs index c2f7106..0030596 100644 --- a/lib/legacy/react.mjs +++ b/lib/legacy/react.mjs @@ -1,85 +1,85 @@ -import react from 'eslint-plugin-react'; -import path from 'node:path'; -import {fileURLToPath} from 'node:url'; -import js from '@eslint/js'; -import {FlatCompat} from '@eslint/eslintrc'; +import react from 'eslint-plugin-react' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import js from '@eslint/js' +import { FlatCompat } from '@eslint/eslintrc' -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all -}); + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) export default [...compat.extends('plugin:react/recommended'), { - plugins: { - react - }, + plugins: { + react, + }, - rules: { - 'react/display-name': [2], - 'react/forbid-prop-types': [2], - 'react/no-children-prop': [2], - 'react/no-danger': [2], - 'react/no-danger-with-children': [2], - 'react/no-deprecated': [2], - 'react/no-did-mount-set-state': [2], - 'react/no-did-update-set-state': [2], - 'react/no-direct-mutation-state': [2], - 'react/no-find-dom-node': [2], - 'react/no-is-mounted': [2], + rules: { + 'react/display-name': [2], + 'react/forbid-prop-types': [2], + 'react/no-children-prop': [2], + 'react/no-danger': [2], + 'react/no-danger-with-children': [2], + 'react/no-deprecated': [2], + 'react/no-did-mount-set-state': [2], + 'react/no-did-update-set-state': [2], + 'react/no-direct-mutation-state': [2], + 'react/no-find-dom-node': [2], + 'react/no-is-mounted': [2], - 'react/no-multi-comp': [2, { - ignoreStateless: true - }], + 'react/no-multi-comp': [2, { + ignoreStateless: true, + }], - 'react/no-render-return-value': [2], - 'react/no-set-state': [0], - 'react/no-string-refs': [2], - 'react/no-unescaped-entities': [2], - 'react/no-unknown-property': [2], - 'react/no-unused-prop-types': [2], - 'react/prefer-es6-class': [2], - 'react/prefer-stateless-function': [2], - 'react/prop-types': [2], - 'react/react-in-jsx-scope': [2], - 'react/require-optimization': [0], - 'react/require-render-return': [2], - 'react/self-closing-comp': [2], - 'react/sort-comp': [2], - 'react/style-prop-object': [2], - 'react/jsx-boolean-value': [2, 'never'], - 'react/jsx-closing-bracket-location': [2, 'line-aligned'], - 'react/jsx-curly-spacing': [2], - 'react/jsx-equals-spacing': [2], - 'react/jsx-filename-extension': [2], - 'react/jsx-first-prop-new-line': [2, 'multiline'], - 'react/jsx-handler-names': [2], - 'react/jsx-indent': [2], - 'react/jsx-indent-props': [2], - 'react/jsx-key': [2], + 'react/no-render-return-value': [2], + 'react/no-set-state': [0], + 'react/no-string-refs': [2], + 'react/no-unescaped-entities': [2], + 'react/no-unknown-property': [2], + 'react/no-unused-prop-types': [2], + 'react/prefer-es6-class': [2], + 'react/prefer-stateless-function': [2], + 'react/prop-types': [2], + 'react/react-in-jsx-scope': [2], + 'react/require-optimization': [0], + 'react/require-render-return': [2], + 'react/self-closing-comp': [2], + 'react/sort-comp': [2], + 'react/style-prop-object': [2], + 'react/jsx-boolean-value': [2, 'never'], + 'react/jsx-closing-bracket-location': [2, 'line-aligned'], + 'react/jsx-curly-spacing': [2], + 'react/jsx-equals-spacing': [2], + 'react/jsx-filename-extension': [2], + 'react/jsx-first-prop-new-line': [2, 'multiline'], + 'react/jsx-handler-names': [2], + 'react/jsx-indent': [2], + 'react/jsx-indent-props': [2], + 'react/jsx-key': [2], - 'react/jsx-max-props-per-line': [2, { - maximum: 1 - }], + 'react/jsx-max-props-per-line': [2, { + maximum: 1, + }], - 'react/jsx-no-bind': [2, { - ignoreRefs: true - }], + 'react/jsx-no-bind': [2, { + ignoreRefs: true, + }], - 'react/jsx-no-comment-textnodes': [2], - 'react/jsx-no-duplicate-props': [2], - 'react/jsx-no-target-blank': [2], - 'react/jsx-no-undef': [2], + 'react/jsx-no-comment-textnodes': [2], + 'react/jsx-no-duplicate-props': [2], + 'react/jsx-no-target-blank': [2], + 'react/jsx-no-undef': [2], - 'react/jsx-pascal-case': [2, { - allowAllCaps: true - }], + 'react/jsx-pascal-case': [2, { + allowAllCaps: true, + }], - 'react/jsx-tag-spacing': [2], - 'react/jsx-uses-react': [2], - 'react/jsx-uses-vars': [2], - 'react/jsx-wrap-multilines': [2] - } -}]; + 'react/jsx-tag-spacing': [2], + 'react/jsx-uses-react': [2], + 'react/jsx-uses-vars': [2], + 'react/jsx-wrap-multilines': [2], + }, +}] diff --git a/lib/shared/makeConfig.mjs b/lib/shared/makeConfig.mjs index 2dacb37..766933f 100644 --- a/lib/shared/makeConfig.mjs +++ b/lib/shared/makeConfig.mjs @@ -1,30 +1,30 @@ -import jsdoc from 'eslint-plugin-jsdoc'; -import stylistic from '@stylistic/eslint-plugin'; +import jsdoc from 'eslint-plugin-jsdoc' +import stylistic from '@stylistic/eslint-plugin' /** * @typedef {import('eslint').Linter.Config} ESLintConfig */ /** - * @param {Object} options + * @param {object} options Configuration options. * @param {boolean} [options.enableReact] Enable React JSX rules. * @returns {ESLintConfig[]} ESLint configurations. */ const makeConfig = ({ - enableReact, + enableReact, } = {}) => [ - stylistic.configs.customize({ - jsx: enableReact, - }), - jsdoc.configs['flat/recommended'], - { - plugins: { - jsdoc - }, - rules: { - '@stylistic/max-len': ['error', 118], // above 118 doesn't display well in GitHub's 120-column diff views - } - } -]; + stylistic.configs.customize({ + jsx: enableReact, + }), + jsdoc.configs['flat/recommended'], + { + plugins: { + jsdoc, + }, + rules: { + '@stylistic/max-len': ['error', 118], // above 118 doesn't display well in GitHub's 120-column diff views + }, + }, +] -export {makeConfig}; +export { makeConfig } diff --git a/release.config.cjs b/release.config.cjs index a900fd4..1deeca3 100644 --- a/release.config.cjs +++ b/release.config.cjs @@ -1,9 +1,9 @@ module.exports = { - extends: 'scratch-semantic-release-config', - branches: [ - { - name: 'master' - // default channel - } - ] -}; + extends: 'scratch-semantic-release-config', + branches: [ + { + name: 'master', + // default channel + }, + ], +} From e9fa4d04d128453810aabf8dfb6b2d4978fc19ce Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:19:33 -0700 Subject: [PATCH 5/6] feat!: add linting for HTML and Markdown --- README.md | 42 +++--- lib/shared/makeConfig.mjs | 18 +++ package-lock.json | 260 ++++++++++++++++++++++++++++++++++++++ package.json | 2 + 4 files changed, 301 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index cb75b3c..a15d562 100644 --- a/README.md +++ b/README.md @@ -49,24 +49,24 @@ Your config files should be set up like ```javascript // scratch-project/eslint.config.mjs -import nodeConfig from 'eslint-config-scratch/node'; -export default nodeConfig; +import nodeConfig from 'eslint-config-scratch/node' +export default nodeConfig ``` ```javascript // scratch-project/src/eslint.config.mjs -import reactConfig from 'eslint-config-scratch/react'; +import reactConfig from 'eslint-config-scratch/react' /** @type {import('eslint').Linter.Config[]} */ export default [ - reactConfig, - // If you need to add or override settings: - { - rules: { - // ... - } - } -]; + reactConfig, + // If you need to add or override settings: + { + rules: { + // ... + }, + }, +] ``` This will set up all the files in the project for linting as Node.js by default, except for those in `src/`, which @@ -88,19 +88,19 @@ object and customize it as needed. ```javascript // scratch-project/eslint.config.mjs -import {makeConfig} from 'eslint-config-scratch'; -import globals from 'globals'; +import { makeConfig } from 'eslint-config-scratch' +import globals from 'globals' /** @type {import('eslint').Linter.Config[]} */ export default [ - ...makeConfig({ - jsx: true, - }), - { - languageOptions: { - globals: globals.worker, - }, - } + ...makeConfig({ + jsx: true, + }), + { + languageOptions: { + globals: globals.worker, + }, + }, ] ``` diff --git a/lib/shared/makeConfig.mjs b/lib/shared/makeConfig.mjs index 766933f..1ef626b 100644 --- a/lib/shared/makeConfig.mjs +++ b/lib/shared/makeConfig.mjs @@ -1,6 +1,16 @@ +import html from 'eslint-plugin-html' import jsdoc from 'eslint-plugin-jsdoc' +import markdown from 'eslint-plugin-markdown' import stylistic from '@stylistic/eslint-plugin' +import htmlSettings from 'eslint-plugin-html/src/settings.js' + +// See https://www.npmjs.com/package/eslint-plugin-html#user-content-settings +const htmlExtensions = htmlSettings.getSettings({}).htmlExtensions + +// '.html' => '**/*.html' +const htmlGlobs = htmlExtensions.map(ext => `**/*${ext}`) + /** * @typedef {import('eslint').Linter.Config} ESLintConfig */ @@ -17,6 +27,7 @@ const makeConfig = ({ jsx: enableReact, }), jsdoc.configs['flat/recommended'], + ...markdown.configs.recommended, { plugins: { jsdoc, @@ -25,6 +36,13 @@ const makeConfig = ({ '@stylistic/max-len': ['error', 118], // above 118 doesn't display well in GitHub's 120-column diff views }, }, + { + files: htmlGlobs, + plugins: { html }, + settings: { + 'html/html-extensions': htmlExtensions, + }, + }, ] export { makeConfig } diff --git a/package-lock.json b/package-lock.json index 63a7096..8b5cc05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,9 @@ "@eslint/eslintrc": "3.3.1", "@eslint/js": "9.23.0", "@stylistic/eslint-plugin": "4.2.0", + "eslint-plugin-html": "^8.1.2", "eslint-plugin-jsdoc": "50.6.9", + "eslint-plugin-markdown": "^5.1.0", "globals": "16.0.0" }, "devDependencies": { @@ -1802,6 +1804,14 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" }, + "node_modules/@types/mdast": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", + "dependencies": { + "@types/unist": "^2" + } + }, "node_modules/@types/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", @@ -1826,6 +1836,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==" + }, "node_modules/@typescript-eslint/scope-manager": { "version": "8.28.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.28.0.tgz", @@ -2490,6 +2505,33 @@ "node": ">=10" } }, + "node_modules/character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3205,6 +3247,57 @@ "node": ">=8" } }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -3265,6 +3358,17 @@ "dev": true, "license": "MIT" }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-ci": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.1.0.tgz", @@ -3716,6 +3820,17 @@ } } }, + "node_modules/eslint-plugin-html": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-8.1.2.tgz", + "integrity": "sha512-pbRchDV2SmqbCi/Ev/q3aAikzG9BcFe0IjjqjtMn8eTLq71ZUggyJB6CDmuwGAXmYZHrXI12XTfCqvgcnPRqGw==", + "dependencies": { + "htmlparser2": "^9.1.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/eslint-plugin-jsdoc": { "version": "50.6.9", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.9.tgz", @@ -3760,6 +3875,20 @@ "spdx-license-ids": "^3.0.0" } }, + "node_modules/eslint-plugin-markdown": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-5.1.0.tgz", + "integrity": "sha512-SJeyKko1K6GwI0AN6xeCDToXDkfKZfXcexA6B+O2Wr2btUS9GrC+YgwSyVli5DJnctUHjFXcQ2cqTaAmVoLi2A==", + "dependencies": { + "mdast-util-from-markdown": "^0.8.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, "node_modules/eslint-plugin-react": { "version": "7.37.4", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.4.tgz", @@ -4794,6 +4923,24 @@ "dev": true, "license": "ISC" }, + "node_modules/htmlparser2": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "entities": "^4.5.0" + } + }, "node_modules/http-proxy-agent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", @@ -5013,6 +5160,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -5155,6 +5324,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -5221,6 +5399,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-map": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", @@ -5989,6 +6176,31 @@ "node": ">= 0.4" } }, + "node_modules/mdast-util-from-markdown": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", + "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", + "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/meow": { "version": "12.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", @@ -6018,6 +6230,25 @@ "node": ">= 8" } }, + "node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -9115,6 +9346,23 @@ "node": ">=6" } }, + "node_modules/parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/parse-imports": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.2.1.tgz", @@ -14860,6 +15108,18 @@ "node": ">=8" } }, + "node_modules/unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "dependencies": { + "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/universal-user-agent": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", diff --git a/package.json b/package.json index 461a979..440cebc 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,9 @@ "@eslint/eslintrc": "3.3.1", "@eslint/js": "9.23.0", "@stylistic/eslint-plugin": "4.2.0", + "eslint-plugin-html": "^8.1.2", "eslint-plugin-jsdoc": "50.6.9", + "eslint-plugin-markdown": "^5.1.0", "globals": "16.0.0" } } From 99399d1a519593121c687b58cac09e59dedf9a59 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:43:19 -0700 Subject: [PATCH 6/6] fix: the React config should use browser globals --- lib/react.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/react.mjs b/lib/react.mjs index 8717da3..7638574 100644 --- a/lib/react.mjs +++ b/lib/react.mjs @@ -9,7 +9,7 @@ export default [ ...makeConfig({ enableReact: true }), { languageOptions: { - globals: globals.node, + globals: globals.browser, }, }, ]