
Linting of Feature Driven Architecture principles by standard eslint-plugins
But unfortunately, while it can't allow you
Also, strictness level limited by plugins API
More power - in our @feature-driven/eslint-plugin
Overview
See included rules
This config help you
to restrict imports (not private paths, only public API)
import { Issues } from "pages/issues";
import { IssueDetails } from "features/issue-details"
import { Button } from "shared/components/button";
import Routing from "pages";
import { IssueDetails } from "features"
import { Button } from "shared/components";
to order imports (app > pages > features > shared > models)
import { Helper } from "./helpers";
import axios from "axios";
import { data } from "../fixtures";
import { Button } from "shared/components"
import { IssueDetails, RepoList } from "features"
import { debounce } from "shared/helpers"
import axios from "axios";
import { IssueDetails, RepoList } from "features"
import { Button } from "shared/components"
import { debounce } from "shared/helpers"
import { data } from "../fixtures";
import { Helper } from "./helpers";
to use only absolute imports (relative - only for module internal using)
NOTE: Be sure, that your tsconfig allows you to use absolute imports
import Routing from "../../pages"
import { IssueDetails } from "../features";
import { Button } from "../shared/components";
import Routing from "pages"
import { IssueDetails } from "features";
import { Button } from "shared/components";
Get started
-
You'll first need to install ESLint (with default plugins):
$ npm install --save-dev eslint
-
Next, install @feature-driven/eslint-config
:
$ npm install --save-dev @feature-driven/eslint-config
-
Add config to the extends
section of your eslint configuration file. You can omit the eslint-plugin
suffix:
{
"extends": ["@feature-driven"]
}
Further, you can override / disable some rules if needed.
Also
- You want to participate in the development of the project? Have a look at our contributing guide!
Commit like nobody sees, Push like nobody hears
- FAQ