Skip to content

jdb8/eslint-plugin-monorepo

 
 

Repository files navigation

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

Unfortunately, any references to monorepo/* rules (such as in eslint-ignore comments) will have to be updated to point to @jdb8/monorepo/* temporarily. If anyone knows of a way to avoid this when forking an eslint plugin (via some kind of rule aliasing?) please reach out!

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

About

ESLint Plugin for monorepos

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%