diff --git a/its/ruling/src/test/expected/jsts/paper.js/typescript-S4328.json b/its/ruling/src/test/expected/jsts/paper.js/typescript-S4328.json deleted file mode 100644 index 9ec52f83b53..00000000000 --- a/its/ruling/src/test/expected/jsts/paper.js/typescript-S4328.json +++ /dev/null @@ -1,5 +0,0 @@ -{ -"paper.js:gulp/typescript/typescript-definition-test.ts": [ -13 -] -} diff --git a/its/ruling/src/test/expected/jsts/vuetify/typescript-S4328.json b/its/ruling/src/test/expected/jsts/vuetify/typescript-S4328.json index 460b135dc7d..6fbce7ef313 100644 --- a/its/ruling/src/test/expected/jsts/vuetify/typescript-S4328.json +++ b/its/ruling/src/test/expected/jsts/vuetify/typescript-S4328.json @@ -452,57 +452,12 @@ 11, 15 ], -"vuetify:packages/vuetify/src/components/VCalendar/VCalendar.ts": [ -40 -], "vuetify:packages/vuetify/src/components/VCalendar/VCalendarCategory.ts": [ 15 ], -"vuetify:packages/vuetify/src/components/VCalendar/VCalendarDaily.ts": [ -21 -], -"vuetify:packages/vuetify/src/components/VCalendar/VCalendarMonthly.ts": [ -12 -], -"vuetify:packages/vuetify/src/components/VCalendar/VCalendarWeekly.ts": [ -25 -], -"vuetify:packages/vuetify/src/components/VCalendar/mixins/calendar-base.ts": [ -27 -], -"vuetify:packages/vuetify/src/components/VCalendar/mixins/calendar-with-events.ts": [ -31 -], -"vuetify:packages/vuetify/src/components/VCalendar/mixins/calendar-with-intervals.ts": [ -20 -], -"vuetify:packages/vuetify/src/components/VCalendar/mixins/times.ts": [ -11 -], -"vuetify:packages/vuetify/src/components/VCalendar/modes/column.ts": [ -4 -], -"vuetify:packages/vuetify/src/components/VCalendar/modes/common.ts": [ -4 -], -"vuetify:packages/vuetify/src/components/VCalendar/modes/index.ts": [ -4 -], -"vuetify:packages/vuetify/src/components/VCalendar/modes/stack.ts": [ -4 -], -"vuetify:packages/vuetify/src/components/VCalendar/util/events.ts": [ -11 -], "vuetify:packages/vuetify/src/components/VCalendar/util/parser.ts": [ 4 ], -"vuetify:packages/vuetify/src/components/VCalendar/util/props.ts": [ -7 -], -"vuetify:packages/vuetify/src/components/VCalendar/util/timestamp.ts": [ -4 -], "vuetify:packages/vuetify/src/components/VCard/VCard.tsx": [ 10, 11, @@ -679,42 +634,9 @@ 8, 12 ], -"vuetify:packages/vuetify/src/components/VData/VData.ts": [ -9 -], -"vuetify:packages/vuetify/src/components/VDataIterator/VDataFooter.ts": [ -13 -], -"vuetify:packages/vuetify/src/components/VDataIterator/VDataIterator.ts": [ -20 -], -"vuetify:packages/vuetify/src/components/VDatePicker/VDatePicker.ts": [ -34 -], -"vuetify:packages/vuetify/src/components/VDatePicker/VDatePickerDateTable.ts": [ -15 -], -"vuetify:packages/vuetify/src/components/VDatePicker/VDatePickerHeader.ts": [ -21 -], -"vuetify:packages/vuetify/src/components/VDatePicker/VDatePickerMonthTable.ts": [ -13 -], -"vuetify:packages/vuetify/src/components/VDatePicker/VDatePickerYears.ts": [ -20 -], -"vuetify:packages/vuetify/src/components/VDatePicker/mixins/date-picker-table.ts": [ -27 -], "vuetify:packages/vuetify/src/components/VDatePicker/util/__tests__/sanitizeDateString.spec.ts": [ 1 ], -"vuetify:packages/vuetify/src/components/VDatePicker/util/createNativeLocaleFormatter.ts": [ -5 -], -"vuetify:packages/vuetify/src/components/VDatePicker/util/isDateAllowed.ts": [ -4 -], "vuetify:packages/vuetify/src/components/VDefaultsProvider/VDefaultsProvider.tsx": [ 2, 6, @@ -1519,12 +1441,6 @@ 18, 19 ], -"vuetify:packages/vuetify/src/components/VTreeview/VTreeview.ts": [ -10 -], -"vuetify:packages/vuetify/src/components/VTreeview/util/filterTreeItems.ts": [ -5 -], "vuetify:packages/vuetify/src/components/VValidation/VValidation.tsx": [ 2, 5 @@ -1991,12 +1907,7 @@ 7 ], "vuetify:packages/vuetify/src/services/goto/__tests__/goto.spec.ts": [ -6, -16 -], -"vuetify:packages/vuetify/src/services/goto/index.ts": [ -15, -17 +6 ], "vuetify:packages/vuetify/src/util/__tests__/colorUtils.spec.ts": [ 1 diff --git a/packages/jsts/src/rules/S4328/fixtures/nested-package-json-project/package.json b/packages/jsts/src/rules/S4328/fixtures/nested-package-json-project/package.json index 6ff48ecd566..610e3a6226c 100644 --- a/packages/jsts/src/rules/S4328/fixtures/nested-package-json-project/package.json +++ b/packages/jsts/src/rules/S4328/fixtures/nested-package-json-project/package.json @@ -1,4 +1,5 @@ { + "name": "local-dependency", "dependencies": { "top-dependency": "latest" } diff --git a/packages/jsts/src/rules/S4328/rule.ts b/packages/jsts/src/rules/S4328/rule.ts index ee5a70dcf35..e853a4a0183 100644 --- a/packages/jsts/src/rules/S4328/rule.ts +++ b/packages/jsts/src/rules/S4328/rule.ts @@ -184,17 +184,18 @@ function getDependencies(fileName: string) { function getDependenciesFromPackageJson(content: PackageJson) { const result = new Set(); - try { - if (content.dependencies !== undefined) { - addDependencies(result, content.dependencies); - } - if (content.devDependencies !== undefined) { - addDependencies(result, content.devDependencies); - } - if (content.peerDependencies !== undefined) { - addDependencies(result, content.peerDependencies); - } - } catch {} + if (content.name) { + addDependencies(result, { [content.name]: '*' }); + } + if (content.dependencies !== undefined) { + addDependencies(result, content.dependencies); + } + if (content.devDependencies !== undefined) { + addDependencies(result, content.devDependencies); + } + if (content.peerDependencies !== undefined) { + addDependencies(result, content.peerDependencies); + } return result; } diff --git a/packages/jsts/src/rules/S4328/unit.test.ts b/packages/jsts/src/rules/S4328/unit.test.ts index fa1f4376b49..04fdc64bdeb 100644 --- a/packages/jsts/src/rules/S4328/unit.test.ts +++ b/packages/jsts/src/rules/S4328/unit.test.ts @@ -187,6 +187,7 @@ ruleTesterNestedPackage.run('all levels of package.json should be considered', r code: ` import { f as f1 } from 'top-dependency'; import { f as f2 } from 'nested-dependency'; + import { f as f2 } from 'local-dependency'; `, filename: filenameNestedPackage, },