@ls-stack/fast-lint 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -683,13 +683,16 @@ Extra checks for code optimized by the React compiler:
|
|
|
683
683
|
- React components and hooks should create JSX, call hooks or use the `"use memo"` directive (with a suggestion to
|
|
684
684
|
add it)
|
|
685
685
|
- functions calling hooks must be components or hooks, and functions using `"use memo"` must be named like one
|
|
686
|
-
-
|
|
686
|
+
- with `disallowManualMemoization`, `useMemo` and `useCallback` calls are reported, as the compiler memoizes for you
|
|
687
|
+
- functions starting with the `"use no memo"` directive are skipped (only the nearest enclosing function counts)
|
|
687
688
|
|
|
688
689
|
```ts
|
|
689
690
|
type Options = [
|
|
690
691
|
{
|
|
691
692
|
/** Only run in files with an `eslint react-compiler/react-compiler: ["error"` comment (default: false) */
|
|
692
693
|
runOnlyWithEnableCompilerDirective?: boolean
|
|
694
|
+
/** Report `useMemo` and `useCallback` calls (default: false) */
|
|
695
|
+
disallowManualMemoization?: boolean
|
|
693
696
|
},
|
|
694
697
|
]
|
|
695
698
|
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/linux-x64/fast-lint
CHANGED
|
Binary file
|
|
Binary file
|
package/lib/index.d.ts
CHANGED
package/package.json
CHANGED