1.0.1 • Published 4 years ago

@jdb8/eslint-plugin-monorepo v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Forked from upstream with the following changes: https://github.com/azz/eslint-plugin-monorepo/compare/master...jdb8:master

If these changes are merged to eslint-plugin-monorepo, this fork can be deleted.

Until then, this fork can be installed via:

yarn add -D @jdb8/eslint-plugin-monorepo

or

npm install --save-dev @jdb8/eslint-plugin-monorepo

The original README is included below.


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';