Skip to content

[SG-32822] Ban imports from client package internals

Administrator requested to merge contractors/SG-32822 into main

Created by: gitstart-sourcegraph

Description

The possibility to import from package internals doesn't allow us to maintain package public API that we can document and maintain.

Success Criteria

Imports from package internal are banned via the ESLint rule.

Implementation Details

  1. Affected imports are updated
// Should not be allowed
import { DEFAULT_MONACO_OPTIONS } from '@sourcegraph/search-ui/src/input/MonacoQueryInput'

// Should be allowed
import { DEFAULT_MONACO_OPTIONS } from '@sourcegraph/search-ui'
  1. Packages branded and shared should be ignored in this rule because they would require significant work to fix imports.

Refs

Gitstart Ticket Sourcegraph Issue

Test plan

  • Try to import modules from client package internals from all packages except `shared and branded,
  • Confirm that you get an eslint error, when you attempt import

Time Estimate

7.5 hrs

App preview:

Merge request reports

Loading