no-invalid-extension-point-imports rule prevents importing components and utilities from unsupported extension points.
Rule details
UI extensions are organized into separate extension points based on their location in HubSpot (e.g.,crm.record.tab, home), each with its own runtime environment. Components and utilities designed for one extension point cannot be imported in another extension point.
This rule detects when you try to import from a different extension point than the one your code is running in. It determines your current extension point based on the project’s directory structure:
- Code in
extensions/orcards/directories is in the CRM extension point. - Code in
settings/directory is in the Settings extension point. - Code in
pages/directory is in the Pages extension point.
@hubspot/ui-extensions:
Examples
The following example would result in a linting error due to importing from the CRM extension point while in the Settings extension point:@hubspot/ui-extensions: