From 99f62ebd23d3ec318ffd80422f047aa7328b18cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 19:18:27 +0100 Subject: [PATCH] chore(deps-dev): bump the eslint group with 2 updates (#988) * Applyied latest code standards * chore(deps-dev): bump the eslint group with 2 updates Bumps the eslint group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript). Updates `eslint` from 8.53.0 to 8.54.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.53.0...v8.54.0) Updates `eslint-config-standard-with-typescript` from 39.1.1 to 40.0.0 - [Release notes](https://github.com/standard/eslint-config-standard-with-typescript/releases) - [Changelog](https://github.com/standard/eslint-config-standard-with-typescript/blob/master/CHANGELOG.md) - [Commits](https://github.com/standard/eslint-config-standard-with-typescript/compare/v39.1.1...v40.0.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: eslint-config-standard-with-typescript dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint ... Signed-off-by: dependabot[bot] * apply latest code style guide Signed-off-by: Jan Kowalleck * docs Signed-off-by: Jan Kowalleck --------- Signed-off-by: dependabot[bot] Signed-off-by: Jan Kowalleck Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jan Kowalleck --- .eslintrc.js | 4 ++++ HISTORY.md | 5 +++++ package.json | 4 ++-- src/models/hash.ts | 4 ++-- src/models/license.ts | 4 ++-- src/models/lifecycle.ts | 4 ++-- src/serialize/json/normalize.ts | 6 +++--- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5e6e4f3b6..c4b373fcf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -82,6 +82,10 @@ module.exports = { */ fixStyle: 'separate-type-imports' }], + /* @see https://typescript-eslint.io/rules/unbound-method/ */ + '@typescript-eslint/unbound-method': ['error', { + ignoreStatic: true + }], // endregion override rules from plugin 'standard-with-typescript' // region docs /* see https://github.com/microsoft/tsdoc */ diff --git a/HISTORY.md b/HISTORY.md index 0be64656a..2ce4b50b7 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. ## unreleased +* Style + * Apply latest code style guide (via [#988]) + +[#988]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/988 + ## 6.1.0 -- 2023-11-05 * Added diff --git a/package.json b/package.json index 26069e6e2..6ca517659 100644 --- a/package.json +++ b/package.json @@ -82,9 +82,9 @@ "@types/spdx-expression-parse": "^3", "c8": "8.0.1", "deepmerge": "^4.2.2", - "eslint": "8.53.0", + "eslint": "8.54.0", "eslint-config-standard": "17.1.0", - "eslint-config-standard-with-typescript": "39.1.1", + "eslint-config-standard-with-typescript": "40.0.0", "eslint-plugin-header": "3.1.1", "eslint-plugin-jsdoc": "46.9.0", "eslint-plugin-simple-import-sort": "10.0.0", diff --git a/src/models/hash.ts b/src/models/hash.ts index b1e8df5ff..4985b3949 100644 --- a/src/models/hash.ts +++ b/src/models/hash.ts @@ -32,7 +32,7 @@ export type Hash = readonly [ ] export class HashDictionary extends Map implements Sortable { - #compareItems ([a1, c1]: Hash, [a2, c2]: Hash): number { + static #compareItems ([a1, c1]: Hash, [a2, c2]: Hash): number { /* eslint-disable @typescript-eslint/strict-boolean-expressions -- run compares in weighted order */ return a1.localeCompare(a2) || c1.localeCompare(c2) @@ -40,6 +40,6 @@ export class HashDictionary extends Map implements Sortable implements Sortable { - #compareItems (a: License, b: License): number { + static #compareItems (a: License, b: License): number { if (a.constructor === b.constructor) { // @ts-expect-error -- classes are from same type -> they are comparable return a.compare(b) @@ -151,6 +151,6 @@ export class LicenseRepository extends Set implements Sortable } sorted (): License[] { - return Array.from(this).sort(this.#compareItems) + return Array.from(this).sort(LicenseRepository.#compareItems) } } diff --git a/src/models/lifecycle.ts b/src/models/lifecycle.ts index 313ddaa86..e2507cc32 100644 --- a/src/models/lifecycle.ts +++ b/src/models/lifecycle.ts @@ -41,7 +41,7 @@ export class NamedLifecycle implements Comparable { export type Lifecycle = LifecyclePhase | NamedLifecycle export class LifecycleRepository extends Set implements Sortable { - #compareItems (a: Lifecycle, b: Lifecycle): number { + static #compareItems (a: Lifecycle, b: Lifecycle): number { if (a.constructor === b.constructor) { return a instanceof NamedLifecycle ? a.compare(b as NamedLifecycle) @@ -51,6 +51,6 @@ export class LifecycleRepository extends Set implements Sortable 0 ? ( options.sortLists - ? data.copyright.sorted().map(this.#normalizeCopyright) - : Array.from(data.copyright, this.#normalizeCopyright) + ? data.copyright.sorted().map(ComponentEvidenceNormalizer.#normalizeCopyright) + : Array.from(data.copyright, ComponentEvidenceNormalizer.#normalizeCopyright) ) : undefined } } - #normalizeCopyright (c: Stringable): Normalized.Copyright { + static #normalizeCopyright (c: Stringable): Normalized.Copyright { return { text: c.toString() } } }