Skip to content

Commit

Permalink
style&deps
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck committed Jan 9, 2025
1 parent 9fc4c03 commit ad2c602
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ All notable changes to this project will be documented in this file.
* Changed
* Replace usage of internals `Stringable` & `SortableStringables` with public aliases API ([#1192] via [#1202])
This is considered a non-breaking change, as the types are not changed, but made publicly available.
* Style
* Apply latest code style guide (via [#1201])
* Misc
* Support `npm11` ([#1191] via [#1203])

[#1191]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1191
[#1192]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1192
[#1201]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1201
[#1202]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1202
[#1203]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1203

Expand Down
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ const __dirname = path.dirname(__filename)
*/
export default [
...baseCfg,
{
name: 'project-specific',
rules: {
"complexity": ["error", { "max": 15 }]
}
},
{
files: ['**/*.js'],
languageOptions: { sourceType: 'commonjs' }
Expand Down
8 changes: 4 additions & 4 deletions src/models/bomLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ abstract class BomLinkBase implements Stringable, Comparable<Stringable> {
this.value = value
}

get value (): string {
return this.#value
}

/**
* @throws {@link RangeError} if value is invalid
*/
Expand All @@ -44,10 +48,6 @@ abstract class BomLinkBase implements Stringable, Comparable<Stringable> {
this.#value = value
}

get value (): string {
return this.#value
}

compare (other: Stringable): number {
return this.toString().localeCompare(other.toString())
}
Expand Down
1 change: 1 addition & 0 deletions src/models/vulnerability/rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class Rating implements Comparable<Rating> {
this.justification = op.justification
}

/* eslint complexity: ["error", 50] -- acknowledged */
compare (other: Rating): number {
/* eslint-disable @typescript-eslint/strict-boolean-expressions -- run compares in weighted order */
return ((this.score ?? 0) - (other.score ?? 0)) ||
Expand Down
1 change: 1 addition & 0 deletions src/models/vulnerability/vulnerability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class Vulnerability implements Comparable<Vulnerability> {
return this.#bomRef
}

/* eslint complexity: ["error", 50] -- acknowledged */
compare (other: Vulnerability): number {
const bomRefCompare = this.bomRef.compare(other.bomRef)
if (bomRefCompare !== 0) {
Expand Down
5 changes: 5 additions & 0 deletions src/serialize/json/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

/* eslint complexity: ["error", 50 ] -- acknowledged */
/* eslint max-lines: 'off' -- intended */

import { chainI } from "../../_helpers/iterable";
import { isNotUndefined } from '../../_helpers/notUndefined'
import type { SortableIterable } from '../../_helpers/sortable'
Expand All @@ -35,6 +38,8 @@ import type { NormalizerOptions } from '../types'
import type { Normalized } from './types'
import { JsonSchema } from './types'



export class Factory {
readonly #spec: Spec

Expand Down
5 changes: 5 additions & 0 deletions src/serialize/xml/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

/* eslint complexity: ["error", 50 ] -- acknowledged */
/* eslint max-lines: 'off' -- intended */

import { chainI } from "../../_helpers/iterable";
import { isNotUndefined } from '../../_helpers/notUndefined'
import type { SortableIterable } from '../../_helpers/sortable'
Expand All @@ -36,6 +39,8 @@ import { normalizedString, token} from './_xsd'
import type { SimpleXml } from './types'
import { XmlSchema } from './types'



export class Factory {
readonly #spec: Spec

Expand Down

0 comments on commit ad2c602

Please sign in to comment.