@fullstackjosh/eslint-plugin-architected
v0.1.0
Published
Enforce layering your code following my personal preferences, based on Jason Taylor's Clean Architecture.
Downloads
14
Readme
eslint-plugin-architected
Enforce layering your code following my personal preferences, based on Jason Taylor's Clean Architecture.
If you'd like a more strict implementation of clean architecture, checkout eslint-plugin-clean-architecture.
Installation
npm i -D @fullstackjosh/eslint-plugin-architected
Usage
// .eslintrc.js
module.exports = {
extends: ["plugin:@fullstackjosh/architected/clean-ish"],
};
You will only be able to import code from layer X to layer Y if layer X depends on layer Y. Any other layer-to-layer import will yield a linting error.
For example:
// 2-application/business-logic.js
import { apiMethod } from "../1-presentation/api";
// error: Do not import 1-presentation code into the 2-application layer
Folder structure
layered-code
| 0-presentation
| 1-infrastructure
| 2-application
| 3-domain
| 4-data