From d743e3775d61728b7fa718c636542b0e87b19bf1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:42:28 +0000 Subject: [PATCH 1/4] Bump eslint-plugin-perfectionist in /packages/collector Bumps [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist) from 3.9.1 to 4.1.1. - [Release notes](https://github.com/azat-io/eslint-plugin-perfectionist/releases) - [Changelog](https://github.com/azat-io/eslint-plugin-perfectionist/blob/main/changelog.md) - [Commits](https://github.com/azat-io/eslint-plugin-perfectionist/compare/v3.9.1...v4.1.1) --- updated-dependencies: - dependency-name: eslint-plugin-perfectionist dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/collector/package-lock.json | 148 ++++++++++++++++++++++----- packages/collector/package.json | 2 +- 2 files changed, 122 insertions(+), 28 deletions(-) diff --git a/packages/collector/package-lock.json b/packages/collector/package-lock.json index 00b9c34b2..10500c5c7 100644 --- a/packages/collector/package-lock.json +++ b/packages/collector/package-lock.json @@ -22,7 +22,7 @@ "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-jest": "^28.9.0", - "eslint-plugin-perfectionist": "^3.9.1", + "eslint-plugin-perfectionist": "^4.1.1", "eslint-plugin-prefer-arrow-functions": "^3.4.1", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", @@ -3393,46 +3393,136 @@ } }, "node_modules/eslint-plugin-perfectionist": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-3.9.1.tgz", - "integrity": "sha512-9WRzf6XaAxF4Oi5t/3TqKP5zUjERhasHmLFHin2Yw6ZAp/EP/EVA2dr3BhQrrHWCm5SzTMZf0FcjDnBkO2xFkA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-4.1.1.tgz", + "integrity": "sha512-LG1QePdXbDBMfd02o2ooCSlJafFRVzZb9HDqPwn9CKql/NT+ZKthxY00zxqRYJEpWsgjQWf+1vTFt23m1eL+AQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "^8.9.0", - "@typescript-eslint/utils": "^8.9.0", - "minimatch": "^9.0.5", - "natural-compare-lite": "^1.4.0" + "@typescript-eslint/types": "^8.16.0", + "@typescript-eslint/utils": "^8.16.0", + "natural-orderby": "^5.0.0" }, "engines": { "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "astro-eslint-parser": "^1.0.2", - "eslint": ">=8.0.0", - "svelte": ">=3.0.0", - "svelte-eslint-parser": "^0.41.1", - "vue-eslint-parser": ">=9.0.0" + "eslint": ">=8.0.0" + } + }, + "node_modules/eslint-plugin-perfectionist/node_modules/@typescript-eslint/scope-manager": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", + "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-perfectionist/node_modules/@typescript-eslint/types": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", + "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-perfectionist/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", + "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.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": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependenciesMeta": { - "astro-eslint-parser": { - "optional": true - }, - "svelte": { - "optional": true - }, - "svelte-eslint-parser": { + "typescript": { "optional": true - }, - "vue-eslint-parser": { + } + } + }, + "node_modules/eslint-plugin-perfectionist/node_modules/@typescript-eslint/utils": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", + "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/typescript-estree": "8.16.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" + }, + "peerDependenciesMeta": { + "typescript": { "optional": true } } }, + "node_modules/eslint-plugin-perfectionist/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", + "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.16.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/eslint-plugin-perfectionist/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==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -3442,6 +3532,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -5631,12 +5722,15 @@ "dev": true, "license": "MIT" }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "node_modules/natural-orderby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/natural-orderby/-/natural-orderby-5.0.0.tgz", + "integrity": "sha512-kKHJhxwpR/Okycz4HhQKKlhWe4ASEfPgkSWNmKFHd7+ezuQlxkA5cM3+XkBPvm1gmHen3w53qsYAv+8GwRrBlg==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/nice-try": { "version": "1.0.5", diff --git a/packages/collector/package.json b/packages/collector/package.json index d880b196c..42d89e323 100644 --- a/packages/collector/package.json +++ b/packages/collector/package.json @@ -33,7 +33,7 @@ "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-jest": "^28.9.0", - "eslint-plugin-perfectionist": "^3.9.1", + "eslint-plugin-perfectionist": "^4.1.1", "eslint-plugin-prefer-arrow-functions": "^3.4.1", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", From 7cc3d6460267ae2743cc18977eb2d36842917572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Tue, 26 Nov 2024 00:01:12 +0100 Subject: [PATCH 2/4] Not applying no-use-before-define to functions --- packages/collector/eslint.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/collector/eslint.config.js b/packages/collector/eslint.config.js index 78df76578..b28889fb3 100644 --- a/packages/collector/eslint.config.js +++ b/packages/collector/eslint.config.js @@ -74,7 +74,10 @@ export default tseslint.config( "error", "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/no-use-before-define": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { functions: false }, + ], "@typescript-eslint/no-useless-empty-export": "error", "@typescript-eslint/parameter-properties": "error", "@typescript-eslint/prefer-enum-initializers": "error", From 8faa8019cf1c71de38f5697c05c7b5dfe8c65c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Tue, 26 Nov 2024 00:01:26 +0100 Subject: [PATCH 3/4] Applied new perfectionist rules --- packages/collector/eslint.config.js | 2 +- .../collector/src/interfaces/ProjectInfo.ts | 174 +++++++++--------- .../src/interfaces/ProjectListing.ts | 4 +- 3 files changed, 90 insertions(+), 90 deletions(-) diff --git a/packages/collector/eslint.config.js b/packages/collector/eslint.config.js index b28889fb3..f4df0ba49 100644 --- a/packages/collector/eslint.config.js +++ b/packages/collector/eslint.config.js @@ -1,6 +1,6 @@ -import js from "@eslint/js"; import eslintComments from "@eslint-community/eslint-plugin-eslint-comments"; import commentsConfig from "@eslint-community/eslint-plugin-eslint-comments/configs"; +import js from "@eslint/js"; import jest from "eslint-plugin-jest"; import perfectionist from "eslint-plugin-perfectionist"; import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions"; diff --git a/packages/collector/src/interfaces/ProjectInfo.ts b/packages/collector/src/interfaces/ProjectInfo.ts index 3e4456f3c..b04d553a0 100644 --- a/packages/collector/src/interfaces/ProjectInfo.ts +++ b/packages/collector/src/interfaces/ProjectInfo.ts @@ -2,17 +2,20 @@ import type { PoptavkyError } from "../exceptions/PoptavkyError"; import { ProjectInfoError } from "../exceptions/ProjectInfoError"; -interface ProjectInfoMaintainer { - email?: string; +export interface ProjectInfo { + description: string; + "help-issue-label"?: string; + links: Array; + maintainers: Array; name: string; + "short-description": string; + tags?: Array; } -interface ProjectInfoLinkSlack { - channel: string; - space: string; - type: "slack"; - uri: string; -} +type ProjectInfoLink = + | ProjectInfoLinkNamed + | ProjectInfoLinkOther + | ProjectInfoLinkSlack; interface ProjectInfoLinkNamed { name: string; @@ -25,87 +28,16 @@ interface ProjectInfoLinkOther { uri: string; } -type ProjectInfoLink = - | ProjectInfoLinkNamed - | ProjectInfoLinkOther - | ProjectInfoLinkSlack; - -export interface ProjectInfo { - description: string; - "help-issue-label"?: string; - links: Array; - maintainers: Array; - name: string; - "short-description": string; - tags?: Array; -} - -function assertIsProjectInfoMaintainer( - maintainer: unknown, - errorFn: (e: string) => PoptavkyError, -): asserts maintainer is ProjectInfoMaintainer { - if (typeof maintainer !== "object" || maintainer === null) { - throw errorFn("The maintainer isn't a valid object."); - } - if (!("name" in maintainer)) { - throw errorFn('The maintainer doesn\'t contain the required field "name".'); - } - if (typeof maintainer.name !== "string") { - throw errorFn('The field "name" is not a string.'); - } - if ("email" in maintainer && typeof maintainer.email !== "string") { - throw errorFn('The field "email" is not a string.'); - } +interface ProjectInfoLinkSlack { + channel: string; + space: string; + type: "slack"; + uri: string; } -function assertIsProjectInfoLink( - link: unknown, - errorFn: (e: string) => PoptavkyError, -): asserts link is ProjectInfoLink { - if (typeof link !== "object" || link === null) { - throw errorFn("The link isn't a valid object."); - } - if (!("type" in link)) { - throw errorFn('The link doesn\'t contain the required field "type".'); - } - if (!("uri" in link)) { - throw errorFn('The link doesn\'t contain the required field "uri".'); - } - if (typeof link.type !== "string") { - throw errorFn('The field "type" is not a string.'); - } - if (typeof link.uri !== "string") { - throw errorFn('The field "uri" is not a string.'); - } - if (link.type === "slack") { - if (!("space" in link)) { - throw errorFn('The link doesn\'t contain the field "space".'); - } - if (!("channel" in link)) { - throw errorFn('The link doesn\'t contain the field "channel".'); - } - if (typeof link.space !== "string") { - throw errorFn('The field "space" is not a string.'); - } - if (typeof link.channel !== "string") { - throw errorFn('The field "channel" is not a string.'); - } - } else if ( - ["facebook-group", "facebook-page", "github-repo"].includes(link.type) - ) { - if (!("name" in link)) { - throw errorFn('The link doesn\'t contain the field "name".'); - } - if (typeof link.name !== "string") { - throw errorFn('The field "name" is not a string.'); - } - } else if ( - !["demo", "docs", "email", "homepage", "issue-tracker", "wiki"].includes( - link.type, - ) - ) { - throw errorFn("The link type is unsupported."); - } +interface ProjectInfoMaintainer { + email?: string; + name: string; } export function assertIsProjectInfo( @@ -186,3 +118,71 @@ export function assertIsProjectInfo( } } } + +function assertIsProjectInfoLink( + link: unknown, + errorFn: (e: string) => PoptavkyError, +): asserts link is ProjectInfoLink { + if (typeof link !== "object" || link === null) { + throw errorFn("The link isn't a valid object."); + } + if (!("type" in link)) { + throw errorFn('The link doesn\'t contain the required field "type".'); + } + if (!("uri" in link)) { + throw errorFn('The link doesn\'t contain the required field "uri".'); + } + if (typeof link.type !== "string") { + throw errorFn('The field "type" is not a string.'); + } + if (typeof link.uri !== "string") { + throw errorFn('The field "uri" is not a string.'); + } + if (link.type === "slack") { + if (!("space" in link)) { + throw errorFn('The link doesn\'t contain the field "space".'); + } + if (!("channel" in link)) { + throw errorFn('The link doesn\'t contain the field "channel".'); + } + if (typeof link.space !== "string") { + throw errorFn('The field "space" is not a string.'); + } + if (typeof link.channel !== "string") { + throw errorFn('The field "channel" is not a string.'); + } + } else if ( + ["facebook-group", "facebook-page", "github-repo"].includes(link.type) + ) { + if (!("name" in link)) { + throw errorFn('The link doesn\'t contain the field "name".'); + } + if (typeof link.name !== "string") { + throw errorFn('The field "name" is not a string.'); + } + } else if ( + !["demo", "docs", "email", "homepage", "issue-tracker", "wiki"].includes( + link.type, + ) + ) { + throw errorFn("The link type is unsupported."); + } +} + +function assertIsProjectInfoMaintainer( + maintainer: unknown, + errorFn: (e: string) => PoptavkyError, +): asserts maintainer is ProjectInfoMaintainer { + if (typeof maintainer !== "object" || maintainer === null) { + throw errorFn("The maintainer isn't a valid object."); + } + if (!("name" in maintainer)) { + throw errorFn('The maintainer doesn\'t contain the required field "name".'); + } + if (typeof maintainer.name !== "string") { + throw errorFn('The field "name" is not a string.'); + } + if ("email" in maintainer && typeof maintainer.email !== "string") { + throw errorFn('The field "email" is not a string.'); + } +} diff --git a/packages/collector/src/interfaces/ProjectListing.ts b/packages/collector/src/interfaces/ProjectListing.ts index 8c6734825..7bef61eae 100644 --- a/packages/collector/src/interfaces/ProjectListing.ts +++ b/packages/collector/src/interfaces/ProjectListing.ts @@ -2,7 +2,7 @@ import type { Project } from "./Project"; import type { ProjectInfo } from "./ProjectInfo"; import type { ProjectIssue } from "./ProjectIssue"; -export type ProjectListing = { +export type ProjectListing = Project & { info: ProjectInfo; issues: Array; -} & Project; +}; From 10f2b2f237c469a455c325ac8e5987afb5fe5e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Tue, 26 Nov 2024 00:03:19 +0100 Subject: [PATCH 4/4] Updated eslint-plugin-perfectionist to v4.1.2 --- packages/collector/package-lock.json | 8 ++++---- packages/collector/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/collector/package-lock.json b/packages/collector/package-lock.json index 10500c5c7..b6a8db731 100644 --- a/packages/collector/package-lock.json +++ b/packages/collector/package-lock.json @@ -22,7 +22,7 @@ "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-jest": "^28.9.0", - "eslint-plugin-perfectionist": "^4.1.1", + "eslint-plugin-perfectionist": "^4.1.2", "eslint-plugin-prefer-arrow-functions": "^3.4.1", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", @@ -3393,9 +3393,9 @@ } }, "node_modules/eslint-plugin-perfectionist": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-4.1.1.tgz", - "integrity": "sha512-LG1QePdXbDBMfd02o2ooCSlJafFRVzZb9HDqPwn9CKql/NT+ZKthxY00zxqRYJEpWsgjQWf+1vTFt23m1eL+AQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-4.1.2.tgz", + "integrity": "sha512-YjXPWB/rKe/gPUsyuxw75wTUrzN5MuJnRV0PH9NoonFvgcdVIXk551mkBKPr59nRZCbu7S3dFHwfo4gA42DB2w==", "dev": true, "license": "MIT", "dependencies": { diff --git a/packages/collector/package.json b/packages/collector/package.json index 42d89e323..8d1fad6db 100644 --- a/packages/collector/package.json +++ b/packages/collector/package.json @@ -33,7 +33,7 @@ "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-jest": "^28.9.0", - "eslint-plugin-perfectionist": "^4.1.1", + "eslint-plugin-perfectionist": "^4.1.2", "eslint-plugin-prefer-arrow-functions": "^3.4.1", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0",