Skip to content

Commit 4e73b2f

Browse files
committed
Update ESLint rules and configurations
1 parent 6604537 commit 4e73b2f

File tree

1 file changed

+48
-19
lines changed

1 file changed

+48
-19
lines changed

README.md

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,56 @@
55
[![CodeQL](../../actions/workflows/codeql.yml/badge.svg)](../../actions/workflows/codeql.yml)
66
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/tomerh2001/eslint-plugin-th-rules/badge)](https://securityscorecards.dev/viewer/?uri=github.com/tomerh2001/eslint-plugin-th-rules)
77

8+
This repository contains custom ESLint rules to enhance code quality and consistency across projects.
9+
10+
# Custom ESLint Rules
11+
812
This repository contains custom ESLint rules to enhance code quality and consistency across projects, created by Tomer Horowitz.
913

1014
## Configurations
1115

16+
### All
1217
To add all of the rules into your project, add the following configuration into your ESLint configuration file:
1318

14-
\`\`\`json
19+
```json
1520
{
1621
"extends": ["plugin:th-rules/all"]
1722
}
18-
\`\`\`
23+
```
24+
25+
### All React
26+
```json
27+
{
28+
"extends": ["plugin:th-rules/all-react"]
29+
}
30+
```
31+
32+
### All React Native
33+
```json
34+
{
35+
"extends": ["plugin:th-rules/all-react-native"]
36+
}
37+
```
38+
39+
### Recommended
40+
```json
41+
{
42+
"extends": ["plugin:th-rules/recommended"]
43+
}
44+
```
45+
46+
### Basic
47+
```json
48+
{
49+
"extends": ["plugin:th-rules/basic"]
50+
}
51+
```
1952

2053
## Rules
2154

22-
### 1. No-Destructuring Rule
55+
### 1. No-Destruction Rule
2356

24-
**Rule ID:** \`th-rules/no-destructuring\`
57+
**Rule ID:** `th-rules/no-destructuring`
2558

2659
#### Description
2760

@@ -37,17 +70,17 @@ This rule checks for:
3770

3871
#### Configuration
3972

40-
\`\`\`json
73+
```json
4174
{
4275
"rules": {
4376
"th-rules/no-destructuring": ["error", { "maximumDestructuredVariables": 2, "maximumLineLength": 100 }]
4477
}
4578
}
46-
\`\`\`
79+
```
4780

48-
### 2. No-Default-Export Rule
81+
### 2. Name-Export Rule
4982

50-
**Rule ID:** \`th-rules/no-default-export\`
83+
**Rule ID:** `th-rules/no-default-export`
5184

5285
#### Description
5386

@@ -58,27 +91,23 @@ Converts unnamed default exports to named default exports based on the file name
5891
This rule targets unnamed default exports and automatically generates a named export based on the file name.
5992

6093
#### Configuration
61-
62-
\`\`\`json
94+
```json
6395
{
6496
"rules": {
65-
"th-rules/no-default-export": "error"
97+
"no-default-export": "error"
6698
}
6799
}
68-
\`\`\`
100+
```
69101

70102
## Installation
71-
72-
To use these rules in your project, first install the plugin and then add it to your ESLint configuration:
73-
74-
\`\`\`json
103+
```json
75104
{
76105
"plugins": [
77106
"th-rules"
78107
],
79108
"rules": {
80-
"th-rules/no-destructuring": "error",
81-
"th-rules/no-default-export": "error"
109+
"no-destructuring": "error",
110+
"no-default-export": "error"
82111
}
83112
}
84-
\`\`\`
113+
```

0 commit comments

Comments
 (0)