Skip to content

Commit 6d20379

Browse files
chore(deps-dev): bump the eslint group with 1 update (#1245)
* chore(deps-dev): bump the eslint group with 1 update Bumps the eslint group with 1 update: [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript). - [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@v40.0.0...v42.0.0) --- updated-dependencies: - 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]> * type assert Signed-off-by: Jan Kowalleck <[email protected]> * foof 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]>
1 parent ed73b3a commit 6d20379

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

HISTORY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ All notable changes to this project will be documented in this file.
55
## unreleased
66

77
* Changed
8-
* Hardened JSON imports (via [#1242])
8+
* Hardened JSON imports (via [#1242], [#1245])
99
* Build
1010
* Use _TypeScript_ `v5.3.3` now, was `v5.3.2` (via [#1244])
1111

1212
[#1242]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1242
1313
[#1244]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1244
14+
[#1245]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1245
1415

1516
## 3.8.3 - 2023-12-01
1617

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"c8": "^8.0.1",
6565
"eslint": "8.55.0",
6666
"eslint-config-standard": "17.1.0",
67-
"eslint-config-standard-with-typescript": "40.0.0",
67+
"eslint-config-standard-with-typescript": "42.0.0",
6868
"eslint-plugin-header": "3.1.1",
6969
"eslint-plugin-simple-import-sort": "10.0.0",
7070
"jest": "29.7.0",

src/_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function getPackageDescription (path: string): PackageDescription | undef
3232
try {
3333
return {
3434
path: packageJson,
35-
packageJson: loadJsonFile(packageJson)
35+
packageJson: loadJsonFile(packageJson) ?? {}
3636
}
3737
} catch {
3838
return undefined

src/extractor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class Extractor {
6060
logger?.log('try to build new Component from PkgPath', pkg.path)
6161
try {
6262
const _packageJson = structuredClonePolyfill(pkg.packageJson)
63-
normalizePackageJson(_packageJson /* add debug for warnings? */)
63+
normalizePackageJson(_packageJson as object /* add debug for warnings? */)
6464
// region fix normalizations
6565
if (typeof pkg.packageJson === 'string') {
6666
// allow non-SemVer strings
@@ -71,7 +71,7 @@ export class Extractor {
7171
} catch (e) {
7272
logger?.warn('normalizePackageJson from PkgPath', pkg.path, 'failed:', e)
7373
}
74-
component = pkgs[pkg.path] = this.#componentBuilder.makeComponent(pkg.packageJson)
74+
component = pkgs[pkg.path] = this.#componentBuilder.makeComponent(pkg.packageJson as object)
7575
logger?.debug('built', component, 'based on', pkg, 'for module', module)
7676
}
7777
if (component !== undefined) {

src/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export class CycloneDxWebpackPlugin {
300300
builder: CDX.Builders.FromNodePackageJson.ComponentBuilder,
301301
logger: WebpackLogger
302302
): CDX.Models.Component | undefined {
303-
const thisPackageJson = this.rootComponentAutodetect
303+
const thisPackageJson: object = this.rootComponentAutodetect
304304
? getPackageDescription(path)?.packageJson
305305
: { name: this.rootComponentName, version: this.rootComponentVersion }
306306
if (thisPackageJson === undefined) { return undefined }
@@ -354,7 +354,7 @@ export class CycloneDxWebpackPlugin {
354354

355355
for (const packageJsonPath of packageJsonPaths) {
356356
logger.log('try to build new Tool from PkgPath', packageJsonPath)
357-
const packageJson = loadJsonFile(packageJsonPath)
357+
const packageJson: object = loadJsonFile(packageJsonPath) ?? {}
358358
normalizePackageJson(packageJson, w => { logger.debug('normalizePackageJson from PkgPath', packageJsonPath, 'caused:', w) })
359359
const tool = builder.makeTool(packageJson)
360360
if (tool !== undefined) {

0 commit comments

Comments
 (0)