eslint-plugin-monorepo

0.3.2 • Public • Published

eslint-plugin-monorepo

Travis Prettier npm semantic-release License

A collection of ESLint rules for enforcing import rules in a monorepo. Supports:

Configuration

Use the "recommended" configuration:

// .eslintrc.json
{
  "extends": ["plugin:monorepo/recommended"]
}

Or enable rules manually:

// .eslintrc.json
{
  "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.

// Bad
import 'module/src/foo.js';
 
// Good
import { foo } from 'module';

monorepo/no-relative-import (fixable)

Forbids importing other packages from the monorepo with a relative path.

// Bad
import module from '../module';
 
// Good
import module from 'module';

Package Sidebar

Install

npm i eslint-plugin-monorepo

Weekly Downloads

25,536

Version

0.3.2

License

MIT

Unpacked Size

13 kB

Total Files

9

Last publish

Collaborators

  • azz