Skip to content

Commit 447f395

Browse files
committed
style&deps
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 9fc4c03 commit 447f395

File tree

7 files changed

+23
-4
lines changed

7 files changed

+23
-4
lines changed

HISTORY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ All notable changes to this project will be documented in this file.
1212
* Changed
1313
* Replace usage of internals `Stringable` & `SortableStringables` with public aliases API ([#1192] via [#1202])
1414
This is considered a non-breaking change, as the types are not changed, but made publicly available.
15+
* Style
16+
* Apply latest code style guide (via [#1201])
1517
* Misc
1618
* Support `npm11` ([#1191] via [#1203])
1719

1820
[#1191]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1191
1921
[#1192]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1192
22+
[#1201]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1201
2023
[#1202]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1202
2124
[#1203]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1203
2225

eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const __dirname = path.dirname(__filename)
3333
*/
3434
export default [
3535
...baseCfg,
36+
{
37+
name: 'project-specific',
38+
rules: {
39+
"complexity": ["error", { "max": 15 }]
40+
}
41+
},
3642
{
3743
files: ['**/*.js'],
3844
languageOptions: { sourceType: 'commonjs' }

src/models/bomLink.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ abstract class BomLinkBase implements Stringable, Comparable<Stringable> {
3434
this.value = value
3535
}
3636

37+
get value (): string {
38+
return this.#value
39+
}
40+
3741
/**
3842
* @throws {@link RangeError} if value is invalid
3943
*/
@@ -44,10 +48,6 @@ abstract class BomLinkBase implements Stringable, Comparable<Stringable> {
4448
this.#value = value
4549
}
4650

47-
get value (): string {
48-
return this.#value
49-
}
50-
5151
compare (other: Stringable): number {
5252
return this.toString().localeCompare(other.toString())
5353
}

src/models/vulnerability/rating.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export class Rating implements Comparable<Rating> {
4848
this.justification = op.justification
4949
}
5050

51+
/* eslint complexity: ["error", 50] -- acknowledged */
5152
compare (other: Rating): number {
5253
/* eslint-disable @typescript-eslint/strict-boolean-expressions -- run compares in weighted order */
5354
return ((this.score ?? 0) - (other.score ?? 0)) ||

src/models/vulnerability/vulnerability.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export class Vulnerability implements Comparable<Vulnerability> {
9898
return this.#bomRef
9999
}
100100

101+
/* eslint complexity: ["error", 50] -- acknowledged */
101102
compare (other: Vulnerability): number {
102103
const bomRefCompare = this.bomRef.compare(other.bomRef)
103104
if (bomRefCompare !== 0) {

src/serialize/json/normalize.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ import type { NormalizerOptions } from '../types'
3535
import type { Normalized } from './types'
3636
import { JsonSchema } from './types'
3737

38+
39+
/* eslint complexity: ["error", 50 ] -- acknowledged */
40+
/* eslint max-lines: 'off' -- intended */
41+
42+
3843
export class Factory {
3944
readonly #spec: Spec
4045

src/serialize/xml/normalize.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import { normalizedString, token} from './_xsd'
3636
import type { SimpleXml } from './types'
3737
import { XmlSchema } from './types'
3838

39+
/* eslint complexity: ["error", 50 ] -- acknowledged */
40+
/* eslint max-lines: 'off' -- intended */
41+
3942
export class Factory {
4043
readonly #spec: Spec
4144

0 commit comments

Comments
 (0)