Skip to content

Commit

Permalink
chore(deps-dev): bump the eslint group with 2 updates (#988)
Browse files Browse the repository at this point in the history
* 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](eslint/eslint@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](mightyiam/eslint-config-love@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] <[email protected]>

* apply latest code style guide

Signed-off-by: Jan Kowalleck <[email protected]>

* docs

Signed-off-by: Jan Kowalleck <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jan Kowalleck <[email protected]>
  • Loading branch information
dependabot[bot] and jkowalleck authored Nov 18, 2023
1 parent 1195fd0 commit 99f62eb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/models/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export type Hash = readonly [
]

export class HashDictionary extends Map<Hash[0], Hash[1]> implements Sortable<Hash> {
#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)
/* eslint-enable @typescript-eslint/strict-boolean-expressions */
}

sorted (): Hash[] {
return Array.from(this.entries()).sort(this.#compareItems)
return Array.from(this.entries()).sort(HashDictionary.#compareItems)
}
}
4 changes: 2 additions & 2 deletions src/models/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export type DisjunctiveLicense = NamedLicense | SpdxLicense
export type License = DisjunctiveLicense | LicenseExpression

export class LicenseRepository extends Set<License> implements Sortable<License> {
#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)
Expand All @@ -151,6 +151,6 @@ export class LicenseRepository extends Set<License> implements Sortable<License>
}

sorted (): License[] {
return Array.from(this).sort(this.#compareItems)
return Array.from(this).sort(LicenseRepository.#compareItems)
}
}
4 changes: 2 additions & 2 deletions src/models/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class NamedLifecycle implements Comparable<NamedLifecycle> {
export type Lifecycle = LifecyclePhase | NamedLifecycle

export class LifecycleRepository extends Set<Lifecycle> implements Sortable<Lifecycle> {
#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)
Expand All @@ -51,6 +51,6 @@ export class LifecycleRepository extends Set<Lifecycle> implements Sortable<Life
}

sorted (): Lifecycle[] {
return Array.from(this).sort(this.#compareItems)
return Array.from(this).sort(LifecycleRepository.#compareItems)
}
}
6 changes: 3 additions & 3 deletions src/serialize/json/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,14 @@ export class ComponentEvidenceNormalizer extends BaseJsonNormalizer<Models.Compo
copyright: data.copyright.size > 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() }
}
}
Expand Down

0 comments on commit 99f62eb

Please sign in to comment.