@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
- - functions starting with the `"use no memo"` directive are skipped
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
Binary file
Binary file
package/lib/index.d.ts CHANGED
@@ -205,6 +205,7 @@ export type UseTypesDirectlyAboveUsageOptions = {
205
205
 
206
206
  export type ReactCompilerExtraOptions = {
207
207
  runOnlyWithEnableCompilerDirective?: boolean
208
+ disallowManualMemoization?: boolean
208
209
  }
209
210
 
210
211
  type RuleOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ls-stack/fast-lint",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "description": "Type-aware lint rules of @ls-stack/extended-lint running natively on tsrs, the Rust port of the TypeScript checker",
6
6
  "type": "module",