eslint-plugin-monorepo
A collection of ESLint rules for enforcing import rules in a monorepo. Supports:
Configuration
Use the "recommended"
configuration:
{
"extends": ["plugin:monorepo/recommended"]
}
Or enable rules manually:
{
"plugins": ["monorepo"],
"rules": {
"monorepo/no-internal-import": "error",
"monorepo/no-relative-import": "error"
}
}
Rules
monorepo/no-internal-import
Forbids importing specific files from a monorepo package.
import 'module/src/foo.js';
import { foo } from 'module';
monorepo/no-relative-import
(fixable)
Forbids importing other packages from the monorepo with a relative path.
import module from '../module';
import module from 'module';