Skip to main content
For security and reliability, UI extensions run in a sandboxed web worker environment with restricted APIs. This can cause issues or unexpected behavior when developing UI extensions, especially if you’re not fully familiar with the UI extensions environment. The @hubspot/eslint-config-ui-extensions package provides ESLint rules specifically designed for HubSpot UI extensions, and catches common issues like using unavailable browser APIs, incorrect imports, and other patterns that won’t work in the sandboxed web worker context. It’s recommended to set up ESLint with this configuration when starting a new UI extensions project, but can be implemented at any time.

Automatic configuration

If you don’t yet have linting configured and want to set it up automatically, you can run the hs project lint command from the root of your project to set up the necessary configuration files and dependencies.

Manual installation

Upgrading from v0.x? See the migration guide for step-by-step instructions.
Install ESLint 9+ alongside this package:

Basic usage

Create an eslint.config.js file in the root of your project:
Make sure your package.json has "type": "module" set, then add a lint script:
Run npm run lint to check for linting issues. The basic config above only includes HubSpot UI extensions-specific rules. For a production-ready setup, it’s recommended that you add standard ESLint rules, TypeScript support, React Hooks linting, Prettier compatibility, and unused import detection.

Install additional dependencies

Full config

What each addition provides

JavaScript-only projects

If you’re not using TypeScript, you can simplify the config:

Rules

The rules included in the shared config from @hubspot/eslint-config-ui-extensions are enabled by default, and should always be enabled when building UI extensions.
Last modified on May 7, 2026