WIP:At the moment at alpha testing - use carefully
Linting of FeatureSliced concepts by existing eslint-plugins
- Control Isolation
- Control Decomposition
- Control Public API
- Control Layers & Scopes
- Control Naming
-
You'll first need to install ESLint:
$ npm install -D eslint # or by yarn $ yarn add -D eslint -
Next, install
@feature-sliced/eslint-configand dependencies:$ npm install -D @feature-sliced/eslint-config eslint-plugin-import eslint-plugin-boundaries # or by yarn $ yarn add -D @feature-sliced/eslint-config eslint-plugin-import eslint-plugin-boundaries -
Add config to the
extendssection of your.eslintrcconfiguration file (for recommended rules). You can omit theeslint-configpostfix:{ "extends": ["@feature-sliced"] }
You can partially use the rules
{
"extends": [
"@feature-sliced/eslint-config/rules/import-order",
"@feature-sliced/eslint-config/rules/public-api",
"@feature-sliced/eslint-config/rules/layers-slices"
]
}WARN: Don't use main config (
"@feature-sliced") in customization to avoid rules conflicts.
This plugin can be used also in TypeScript projects using @typescript-eslint/eslint-plugin. Follow next steps to configure it:
-
Install dependencies:
$ npm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript # or by yarn $ yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript -
Configure
@typescript-eslint/parseras parser and setup theeslint-import-resolver-typescriptresolver in the.eslintrcconfig file:{ "parser": "@typescript-eslint/parser", "settings": { "import/resolver": { "typescript": { "alwaysTryTypes": true } } } }
- FAQ
- Releases & Changelog
- How can I help?
- ⭐ Rate us on GitHub
- 💫 Any assistance is important - from feedback to participation in the development of the methodology!