npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hubspot/eslint-config-ui-extensions

v1.1.0

Published

eslint plugins for HubSpot React-based UI Extensions

Readme

@hubspot/eslint-config-ui-extensions

ESLint shareable config for building UI Extensions on HubSpot with React.

This package provides ESLint rules specifically designed for the HubSpot UI Extensions environment. It catches common issues like using unavailable browser APIs, incorrect imports, and other patterns that won't work in the sandboxed web worker context.

Installation

Upgrading from v0.x? See the Migration Guide for step-by-step instructions.

Install ESLint 9+ alongside this package:

npm i --save-dev eslint @hubspot/eslint-config-ui-extensions

Basic Usage

Create an eslint.config.js file in the root of your project:

import { config } from '@hubspot/eslint-config-ui-extensions';

export default [
  ...config,
  // Your project-specific overrides
];

Make sure your package.json has "type": "module" set, then add a lint script:

{
  "type": "module",
  "scripts": {
    "lint": "eslint ."
  }
}

Run npm run lint to check for linting issues.

Recommended Setup

The basic config above only includes HubSpot UI Extensions-specific rules. For a production-ready setup, we recommend adding standard ESLint rules, TypeScript support, React Hooks linting, Prettier compatibility, and unused import detection.

Install Additional Dependencies

npm i --save-dev @eslint/js typescript-eslint eslint-plugin-react eslint-plugin-react-hooks eslint-config-prettier eslint-plugin-unused-imports

Full Recommended Config

import { defineConfig } from 'eslint/config';
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import unusedImports from 'eslint-plugin-unused-imports';
import prettier from 'eslint-config-prettier';
import { config as uiExtensionsConfig } from '@hubspot/eslint-config-ui-extensions';

export default defineConfig([
  // Standard ESLint recommended rules
  js.configs.recommended,

  // TypeScript support with stylistic rules
  tseslint.configs.recommended,
  tseslint.configs.stylistic,

  // React recommended rules + JSX runtime support (React 17+)
  react.configs.flat.recommended,
  react.configs.flat['jsx-runtime'],
  {
    settings: {
      react: { version: 'detect' },
    },
  },

  // HubSpot UI Extensions rules
  ...uiExtensionsConfig,

  // React Hooks rules
  reactHooks.configs.flat['recommended-latest'],

  // Unused imports detection (auto-fixable with --fix)
  {
    plugins: {
      'unused-imports': unusedImports,
    },
    rules: {
      'no-unused-vars': 'off',
      '@typescript-eslint/no-unused-vars': 'off',
      'unused-imports/no-unused-imports': 'error',
      'unused-imports/no-unused-vars': [
        'warn',
        {
          vars: 'all',
          varsIgnorePattern: '^_',
          args: 'after-used',
          argsIgnorePattern: '^_',
        },
      ],
    },
  },

  // Prettier compatibility (must be last to override other configs)
  prettier,
]);

What Each Addition Provides

| Package | Purpose | | :------ | :------ | | @eslint/js | ESLint's built-in recommended rules for catching common JavaScript issues | | typescript-eslint | TypeScript parsing and linting rules (stylistic adds consistent code style enforcement) | | eslint-plugin-react | React-specific rules; jsx-runtime config is for React 17+ (no need to import React in every file) | | eslint-plugin-react-hooks | Enforces Rules of Hooks and verifies dependency arrays | | eslint-config-prettier | Disables ESLint rules that conflict with Prettier formatting | | eslint-plugin-unused-imports | Auto-fixable detection and removal of unused imports |

JavaScript-Only Projects

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

import { defineConfig } from 'eslint/config';
import js from '@eslint/js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import unusedImports from 'eslint-plugin-unused-imports';
import prettier from 'eslint-config-prettier';
import { config as uiExtensionsConfig } from '@hubspot/eslint-config-ui-extensions';

export default defineConfig([
  js.configs.recommended,
  react.configs.flat.recommended,
  react.configs.flat['jsx-runtime'],
  {
    settings: {
      react: { version: 'detect' },
    },
  },
  ...uiExtensionsConfig,
  reactHooks.configs.flat['recommended-latest'],
  {
    plugins: {
      'unused-imports': unusedImports,
    },
    rules: {
      'no-unused-vars': 'off',
      'unused-imports/no-unused-imports': 'error',
      'unused-imports/no-unused-vars': [
        'warn',
        {
          vars: 'all',
          varsIgnorePattern: '^_',
          args: 'after-used',
          argsIgnorePattern: '^_',
        },
      ],
    },
  },
  prettier,
]);

Rules

🔧 Automatically fixable by the --fix CLI option.

| Name                               | Description | 🔧 | | :------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :- | | no-browser-dialogs | Prevent usage of native browser dialog APIs (alert, confirm, and prompt) in UI Extensions. | | | no-browser-storage | Prevent usage of browser storage APIs (localStorage and sessionStorage) in UI Extensions, which run in a sandboxed web worker environment where these APIs are not available. | | | no-console | Prevent usage of console methods in UI Extensions in favor of the SDK logger utility. | | | no-dom-access | Prevent access to the DOM (document object) in UI Extensions, which run in a sandboxed web worker without DOM access. | | | no-experimental-imports | Warn when importing from the experimental path of @hubspot/ui-extensions. | | | no-html-elements | Disallow usage of unsupported HTML elements in UI Extensions. | | | no-invalid-extension-point-imports | Prevent importing components from unsupported extension points. | | | no-invalid-image-src | Only allow valid image URLs in the src attribute of Image components from @hubspot/ui-extensions. | 🔧 | | no-native-http | Prevent usage of native browser HTTP APIs (fetch and XMLHttpRequest) in UI Extensions. | | | no-parent-imports | Prevent importing files from outside the extension point root directory | | | no-restricted-globals | Prevent usage of browser globals that are not available in the sandboxed web worker environment. | |