Registry / testing / eslint-plugin-boundaries

eslint-plugin-boundaries

JSON →
library6.0.2jsnpmunverified

ESLint plugin for enforcing architectural boundaries between elements in JavaScript and TypeScript projects. Current stable version is 6.0.2 (released Feb 2025) with active development. It allows defining layered architectures (e.g., controllers, models, views) with dependency rules that restrict which elements can import from others. Features object-based element selectors (v6), monorepo support, TypeScript types, and real-time ESLint feedback. Differentiators: flexible element/rule definitions, built-in recommended config, and a dedicated documentation site (jsboundaries.dev). Release cadence is roughly monthly. Requires eslint >=6.0.0 and node >=18.18.

npm install eslint-plugin-boundaries
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-BOUN
E
eslint-plugin-boundaries
testingjavascriptv6.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
import boundaries from 'eslint-plugin-boundaries'
const boundaries = require('eslint-plugin-boundaries')
Default import is ESM. In CommonJS, use const boundaries = require('eslint-plugin-boundaries').default (since v6).
rules
import boundaries from 'eslint-plugin-boundaries'; const { rules } = boundaries
import { rules } from 'eslint-plugin-boundaries'
Named export 'rules' is part of the default export object, not a top-level export.
createConfig
import { createConfig } from 'eslint-plugin-boundaries'
import createConfig from 'eslint-plugin-boundaries'
createConfig is a named export (since v6). For ESLint v9/v10 flat config.
configs.recommended
import boundaries from 'eslint-plugin-boundaries'; boundaries.configs.recommended
import { configs } from 'eslint-plugin-boundaries'
configs is a property of the default export.

Configures eslint-plugin-boundaries with element types and dependency rules in flat ESLint config (v9+).

// npm install eslint eslint-plugin-boundaries --save-dev // eslint.config.js (flat config) import boundaries from 'eslint-plugin-boundaries'; export default [ { plugins: { boundaries }, settings: { 'boundaries/elements': [ { type: 'controller', pattern: 'controllers/*' }, { type: 'model', pattern: 'models/*' }, { type: 'view', pattern: 'views/*' }, { type: 'service', pattern: 'services/*' }, { type: 'utility', pattern: 'utils/*' }, ], }, rules: { 'boundaries/element-types': [2, { default: 'disallow', rules: [ { from: 'controller', to: 'view', allow: true }, { from: 'controller', to: 'model', allow: true }, { from: 'view', to: 'controller', allow: false }, { from: 'model', to: 'service', allow: true }, { from: 'service', to: ['model', 'utility'], allow: true }, { from: 'utility', to: ['utility', 'model'], allow: true }, ], }], }, }, ];
Debug
Known issues
breakingESM-only since v6; require() fails without .default
fix
Use import or require('eslint-plugin-boundaries').default
affects: >=6.0.0
breakingno-private rule disabled by default in recommended config since v6.0.0-beta.2
fix
Explicitly enable in rules: 'boundaries/no-private': [2, { allowUncles: true }]
affects: >=6.0.0-beta.2
deprecatedno-private rule is deprecated and will be removed in future major version
fix
Use boundaries/element-types with appropriate rules instead
affects: >=6.0.0
gotchaElements selector validation error when selector is an empty array (v5.3.1 fixed this)
fix
Upgrade to >=5.3.1 or ensure every element has at least one pattern
affects: <5.3.1
gotchaTypeScript createConfig helper types incompatible with ESLint v10 before v6.0.1
fix
Update to v6.0.1 or later
affects: 6.0.0
deprecatedLegacy string-based element selectors are deprecated in v6; use object-based selectors
fix
Migrate elements definition to object form (type + pattern)
affects: >=6.0.0
gotchahandlebars dependency had critical vulnerability GHSA-2w6w-674q-4c4q before v6.0.2
fix
Upgrade to v6.0.2 or later
affects: <6.0.2
Errors
Common errors & fixes
Cannot read properties of undefined (reading 'default')
Using CommonJS require() without .default in ESM-only v6
fix
Use const boundaries = require('eslint-plugin-boundaries').default;
ESLint configuration error: Rule 'boundaries/element-types' is not found
Plugin not added to plugins field in flat config
fix
Add plugins: { boundaries } to the config object (see quickstart)
Boundaries: No element matched for file '...' (settings 'boundaries/elements')
File path does not match any defined element pattern
fix
Add a pattern that matches the file or adjust existing patterns
TypeError: boundaries.createConfig is not a function
Using named import for createConfig in CommonJS without default import
fix
Use import boundaries from 'eslint-plugin-boundaries'; boundaries.createConfig()
Upgrade
Version history
6.0.2latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required at >=6.0.0 to function as a plugin
Agent activity
8 hits · last 30 days
node
8
Resources
eslint-plugin-boundaries — npm install eslint-plugin-boundaries · libregistry