Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LINT-22(DOC): Customization usage #48

Merged
merged 2 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,35 @@ 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
{
"extends": ["@feature-sliced"]
}
```

> 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)
Comment on lines +124 to +144
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Прям даже лучше чем хотелось вышло 👍


## Usage with TypeScript

Expand Down
5 changes: 4 additions & 1 deletion rules/import-order/index.md
Original file line number Diff line number Diff line change
@@ -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.
Comment on lines 1 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Йеее, и про это не забыл 🚀


```js
// 👎 Fail
Expand Down
5 changes: 4 additions & 1 deletion rules/layers-slices-boundaries/index.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion rules/public-api-boundaries/index.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down