Skip to content

Commit 4afc171

Browse files
committed
docs(plugins/naming-convention): update filename rule options docs, closes #859, closes #861
1 parent 26cb74b commit 4afc171

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

website/pages/docs/rules/naming-convention-component-name.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ function ExampleComponent() {
3939
- `rule`: The rule to apply to the file name. Can be one of the following:
4040
1. `PascalCase`: PascalCase
4141
2. `CONSTANT_CASE`: CONSTANT_CASE
42-
- `excepts`: List of component names that should be ignored by this rule.
42+
- `excepts`: (optional) An array of component names that are allowed to not follow the rule.
43+
- `allowAllCaps`: (optional) If `true`, allows all caps file names. Default is `false`.
44+
- `allowNamespace`: (optional) If `true`, allows namespace in JSX elements. Default is `false`.
45+
- `allowLeadingUnderscore`: (optional) If `true`, allows leading underscore in file names. Default is `false`.
4346

4447
```json
4548
{

website/pages/docs/rules/naming-convention-filename.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Enforces naming convention for JSX files. Can be used to enforce PascalCase, cam
1616
npx eslint --rule '@eslint-react/naming-convention/filename: ["warn", { "rule": "PascalCase" }]' .
1717

1818
src/components/Component.tsx
19-
1:1 error "File name `Component.tsx` does not match `PascalCase`. Should rename to `Component.tsx` react/jsx-filename-naming-convention
19+
1:1 error "File name `component.tsx` does not match `PascalCase`. Should rename to `Component.tsx` react/jsx-filename-naming-convention
2020
2121
✖ 1 problems (0 errors, 1 warnings)
2222
```
@@ -55,10 +55,6 @@ src/components/example-component.tsx
5555
2. `camelCase`: camelCase
5656
3. `kebab-case`: kebab-case
5757
4. `snake_case`: snake_case
58-
- `excepts`: (optional) An array of component names that are allowed to not follow the rule.
59-
- `allowAllCaps`: (optional) If `true`, allows all caps file names. Default is `false`.
60-
- `allowNamespace`: (optional) If `true`, allows namespace in JSX elements. Default is `false`.
61-
- `allowLeadingUnderscore`: (optional) If `true`, allows leading underscore in file names. Default is `false`.
6258

6359
## Rule Options Examples
6460

0 commit comments

Comments
 (0)