Skip to content

Commit 13aa93b

Browse files
committed
docs: add docs for rule no-index
1 parent 05a4405 commit 13aa93b

File tree

2 files changed

+21
-26
lines changed

2 files changed

+21
-26
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ Then configure the rules you want to use under the rules section.
4141
"*.test.{js,jsx,ts,tsx}":"**/__tests__/",
4242
"*.styled.{jsx,tsx}":"**/pages/"
4343
}
44-
]
44+
],
45+
"check-file/filename-naming-convention":[
46+
"error",
47+
{
48+
"*.{js,jsx,ts,tsx}":"CAMEL_CASE",
49+
"*.json":"KEBAB_CASE"
50+
}
51+
],
52+
"check-file/no-index":"error"
4553
}
4654
}
4755
```
@@ -50,3 +58,4 @@ Then configure the rules you want to use under the rules section.
5058

5159
- [check-file/folder-match-with-fex](docs/rules/folder-match-with-fex.md): Enforce a consistent naming pattern for the folder of the specified file extension
5260
- [check-file/filename-naming-convention](docs/rules/filename-naming-convention.md): Enforce a consistent naming pattern for the filename of the specified file extension
61+
- [check-file/no-index](docs/rules/no-index.md): A file cannot be named "index"

docs/rules/no-index.md

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,21 @@
1-
# A file cannot be named 'index' (no-index)
1+
# A file cannot be named "index" (no-index)
22

3-
Please describe the origin of the rule here.
3+
Prevents files from being named "index".
44

55
## Rule Details
66

7-
This rule aims to...
7+
This rule aims to prevent files from being named "index", which will lead to files having meaningful names.
88

9-
Examples of **incorrect** code for this rule:
10-
11-
```js
12-
13-
// fill me in
9+
Examples of **incorrect** filename for this rule:
1410

11+
```sh
12+
index.js
13+
index.ts
1514
```
1615

17-
Examples of **correct** code for this rule:
18-
19-
```js
20-
21-
// fill me in
16+
Examples of **correct** filename for this rule:
2217

18+
```sh
19+
calculatePrice.js
20+
login.tsx
2321
```
24-
25-
### Options
26-
27-
If there are any options, describe them here. Otherwise, delete this section.
28-
29-
## When Not To Use It
30-
31-
Give a short description of when it would be appropriate to turn off this rule.
32-
33-
## Further Reading
34-
35-
If there are other links that describe the issue this rule addresses, please include them here in a bulleted list.

0 commit comments

Comments
 (0)