Skip to content

Commit d113cda

Browse files
committed
chore: Update no-comments rule ID and description
1 parent 583c168 commit d113cda

File tree

4 files changed

+69
-75
lines changed

4 files changed

+69
-75
lines changed

README.md

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -29,78 +29,3 @@ This repository contains custom ESLint rules to enhance code quality and consist
2929
### 1. No-destructuring Rule
3030

3131
**Rule ID:** `th-rules/no-destructuring`
32-
33-
#### Description
34-
35-
This rule disallows destructuring that does not meet certain conditions, aiming to prevent overly complex destructuring patterns and ensure code readability.
36-
37-
#### Rule Details
38-
39-
This rule checks for:
40-
41-
- Destructuring at a nesting level above 3.
42-
- Destructuring of more than the specified maximum number of variables (default is 2).
43-
- Destructuring on a line exceeding the specified maximum line length (default is 100 characters).
44-
45-
#### Configuration
46-
47-
```json
48-
{
49-
"rules": {
50-
"th-rules/no-destructuring": ["error", { "maximumDestructuredVariables": 2, "maximumLineLength": 100 }]
51-
}
52-
}
53-
```
54-
55-
### 2. Name-Export Rule
56-
57-
**Rule ID:** `th-rules/no-default-export`
58-
59-
#### Description
60-
61-
Converts unnamed default exports to named default exports based on the file name. This rule helps maintain consistency in export names and facilitates easier identification of components or modules.
62-
63-
#### Rule Details
64-
65-
This rule targets unnamed default exports and automatically generates a named export based on the file name.
66-
67-
#### Configuration
68-
```json
69-
{
70-
"rules": {
71-
"no-default-export": "error"
72-
}
73-
}
74-
```
75-
### 3. No-Comments Rule
76-
77-
**Rule ID:** `th-rules/no-comments`
78-
79-
#### Description
80-
81-
This rule disallows comments unless they match specified allowed patterns. It ensures that only relevant and permitted comments are present in the codebase, such as TODOs, warnings, JSDoc comments, ESLint directives, etc.
82-
83-
#### Rule Details
84-
85-
By default, the following comments are allowed:
86-
87-
- TODO, WARNING, ERROR, INFO (case-insensitive).
88-
- ESLint directives like `/* eslint-disable */`.
89-
- JSDoc comments (any comment starting with `/**`).
90-
91-
You can also configure additional patterns to allow or disallow specific types of comments.
92-
93-
#### Configuration
94-
95-
```json
96-
{
97-
"rules": {
98-
"th-rules/no-comments": [
99-
"error",
100-
{
101-
"allow": ["keep", "important"],
102-
"disallow": ["deprecated", "hack"]
103-
}
104-
]
105-
}
106-
}

docs/rules/no-comments.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,33 @@
1616
| `disallow` | Additional patterns to disallow in comments. | String[] |
1717

1818
<!-- end auto-generated rule options list -->
19+
20+
#### Description
21+
22+
This rule disallows comments unless they match specified allowed patterns. It ensures that only relevant and permitted comments are present in the codebase, such as TODOs, warnings, JSDoc comments, ESLint directives, etc.
23+
24+
#### Rule Details
25+
26+
By default, the following comments are allowed:
27+
28+
- TODO, WARNING, ERROR, INFO (case-insensitive).
29+
- ESLint directives like `/* eslint-disable */`.
30+
- JSDoc comments (any comment starting with `/**`).
31+
32+
You can also configure additional patterns to allow or disallow specific types of comments.
33+
34+
#### Usage
35+
36+
```json
37+
{
38+
"rules": {
39+
"th-rules/no-comments": [
40+
"error",
41+
{
42+
"allow": ["keep", "important"],
43+
"disallow": ["deprecated", "hack"]
44+
}
45+
]
46+
}
47+
}
48+
```

docs/rules/no-default-export.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,20 @@
55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

77
<!-- end auto-generated rule header -->
8+
9+
#### Description
10+
11+
Converts unnamed default exports to named default exports based on the file name. This rule helps maintain consistency in export names and facilitates easier identification of components or modules.
12+
13+
#### Rule Details
14+
15+
This rule targets unnamed default exports and automatically generates a named export based on the file name.
16+
17+
#### Usage
18+
```json
19+
{
20+
"rules": {
21+
"no-default-export": "error"
22+
}
23+
}
24+
```

docs/rules/no-destructuring.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,25 @@
1414
| `maximumLineLength` | Integer |
1515

1616
<!-- end auto-generated rule options list -->
17+
18+
#### Description
19+
20+
This rule disallows destructuring that does not meet certain conditions, aiming to prevent overly complex destructuring patterns and ensure code readability.
21+
22+
#### Rule Details
23+
24+
This rule checks for:
25+
26+
- Destructuring at a nesting level above 3.
27+
- Destructuring of more than the specified maximum number of variables (default is 2).
28+
- Destructuring on a line exceeding the specified maximum line length (default is 100 characters).
29+
30+
#### Usage
31+
32+
```json
33+
{
34+
"rules": {
35+
"th-rules/no-destructuring": ["error", { "maximumDestructuredVariables": 2, "maximumLineLength": 100 }]
36+
}
37+
}
38+
```

0 commit comments

Comments
 (0)