diff --git a/README.md b/README.md index a1f4ccd..dde5186 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ import { Button } from "shared/ui"; npm install --save-dev @feature-sliced/eslint-config eslint-plugin-import eslint-plugin-boundaries ``` -3. Add config to the `extends` section of your eslint configuration file. You can omit the `eslint-plugin` suffix: +3. Add config ( for **recommended** presets ) to the `extends` section of your eslint configuration file. You can omit the `eslint-plugin` suffix: ```json { @@ -121,7 +121,27 @@ import { Button } from "shared/ui"; } ``` -> Further, you can override / disable some rules if needed. +## Customization +You can partially use the rules + +#### Note: +Don't use main config (`@feature-sliced`) in customization to avoid rules conflicts. + +#### Example: +```json + { + "extends": [ + "@feature-sliced/eslint-config/rules/import-order", + "@feature-sliced/eslint-config/rules/public-api-boundaries", + "@feature-sliced/eslint-config/rules/layers-slices-boundaries" + ] + } +``` + +#### Available rules +- [import-order](./rules/import-order/index.md) +- [public-api-boundaries](./rules/public-api-boundaries/index.md) +- [layers-slices-boundaries](./rules/layers-slices-boundaries/index.md) ## Usage with TypeScript diff --git a/rules/import-order/index.md b/rules/import-order/index.md index 06fb534..cf78f80 100644 --- a/rules/import-order/index.md +++ b/rules/import-order/index.md @@ -1,6 +1,9 @@ # @feature-sliced/import-order -Reference: [Layers](https://feature-sliced.design/docs/reference/layers) +#### Reference: [Layers](https://feature-sliced.design/docs/reference/layers) + +#### Usage: +Add `"@feature-sliced/eslint-config/rules/import-order"` to you `extends` section in ESLint config. ```js // 👎 Fail diff --git a/rules/layers-slices-boundaries/index.md b/rules/layers-slices-boundaries/index.md index 96569e5..e3dd9b5 100644 --- a/rules/layers-slices-boundaries/index.md +++ b/rules/layers-slices-boundaries/index.md @@ -1,6 +1,9 @@ # @feature-sliced/layers-slices-boundaries -Reference: [Cross-communication](https://feature-sliced.design/docs/concepts/cross-communication) +#### Reference: [Cross-communication](https://feature-sliced.design/docs/concepts/cross-communication) + +#### Usage: +Add `"@feature-sliced/eslint-config/rules/layers-slices-boundaries"` to you `extends` section in ESLint config. ```js // 👎 Fail diff --git a/rules/public-api-boundaries/index.md b/rules/public-api-boundaries/index.md index ea36cef..0483dc6 100644 --- a/rules/public-api-boundaries/index.md +++ b/rules/public-api-boundaries/index.md @@ -1,6 +1,9 @@ # @feature-sliced/public-api-boundaries -Reference: [PublicAPI](https://feature-sliced.design/docs/concepts/public-api) +#### Reference: [PublicAPI](https://feature-sliced.design/docs/concepts/public-api) + +#### Usage: +Add `"@feature-sliced/eslint-config/rules/public-api-boundaries"` to you `extends` section in ESLint config. ```js // 👎 Fail