Skip to content

Commit 5553cbb

Browse files
committed
Update limitations section README.md [publish]
1 parent 98aa03a commit 5553cbb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ Validate that your components can safely be updated with fast refresh.
66

77
⚠️ To avoid false positive, this plugin is only applied on `tsx` & `jsx` files ⚠️
88

9-
Like the implementation for [vite](https://github.com/vitejs/vite/blob/e6495f0a52c9bd2cae166934dc965f8955ce035d/packages/plugin-react/src/fast-refresh.ts#L108), the plugin rely on naming conventions (i.e. use ). This is why there is some limitations:
9+
Like the implementation for [vite](https://github.com/vitejs/vite/blob/e6495f0a52c9bd2cae166934dc965f8955ce035d/packages/plugin-react/src/fast-refresh.ts#L108), the plugin rely on naming conventions (i.e. use PascalCase for components, camelCase for util functions). This is why there is some limitations:
1010

1111
- `export *` are not supported and will be reported as an error
12-
- anonymous function are not supported (i.e `export default function() {}`)
12+
- Anonymous function are not supported (i.e `export default function() {}`)
13+
- Class components are not supported
1314
- Full uppercase export would be considered as an error. It can be disabled locally when it's effectively a React component:
1415

1516
```jsx
1617
// eslint-disable-next-line react-refresh/eslint-plugin-react-refresh
1718
export const CMS = () => <></>;
1819
```
1920

21+
I may publish a rule base on type information from [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) to improve some limitations and catch some naming convention issues (like non-component function starting with an uppercase).
22+
2023
## Installation
2124

2225
```sh

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eslint-plugin-react-refresh",
33
"description": "Validate that your components can safely be updated with fast refresh",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"license": "MIT",
66
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
77
"main": "src/index.js",

0 commit comments

Comments
 (0)