@jdb8/eslint-plugin-monorepo
v1.0.1
Published
ESLint plugin for monorepos
Downloads
3
Maintainers
Readme
Forked from upstream with the following changes: https://github.com/azz/eslint-plugin-monorepo/compare/master...jdb8:master
- https://github.com/azz/eslint-plugin-monorepo/pull/21
- https://github.com/azz/eslint-plugin-monorepo/pull/29
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
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';