@pawover/eslint-rules 0.0.2 → 0.2.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.
@@ -1,20 +1,105 @@
1
1
  declare const _default: {
2
+ /**
3
+ * @desc 验证 Hooks 依赖数组包含所有必要的依赖
4
+ * @descEN Validates that dependency arrays for React hooks contain all necessary dependencies
5
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/exhaustive-deps
6
+ */
2
7
  "react-hooks/exhaustive-deps": number;
8
+ /**
9
+ * @desc 验证组件和 hooks 遵循 Hooks 规则
10
+ * @descEN Validates that components and hooks follow the Rules of Hooks
11
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/rules-of-hooks
12
+ */
3
13
  "react-hooks/rules-of-hooks": number;
14
+ /**
15
+ * @desc 验证定义嵌套组件或 hooks 的高阶函数
16
+ * @descEN Validates higher order functions defining nested components or hooks
17
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/component-hook-factories
18
+ */
4
19
  "react-hooks/component-hook-factories": number;
20
+ /**
21
+ * @desc 验证编译器配置选项
22
+ * @descEN Validates the compiler configuration options
23
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/config
24
+ */
5
25
  "react-hooks/config": number;
26
+ /**
27
+ * @desc 验证子组件错误是否使用 Error Boundaries
28
+ * @descEN Validates usage of Error Boundaries instead of try/catch for child errors
29
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/error-boundaries
30
+ */
6
31
  "react-hooks/error-boundaries": number;
32
+ /**
33
+ * @desc 验证 gating 模式的配置
34
+ * @descEN Validates configuration of gating mode
35
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/gating
36
+ */
7
37
  "react-hooks/gating": number;
38
+ /**
39
+ * @desc 禁止在 render 期间对全局变量赋值/修改
40
+ * @descEN Validates against assignment/mutation of globals during render
41
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/globals
42
+ */
8
43
  "react-hooks/globals": number;
44
+ /**
45
+ * @desc 禁止修改 props、state 等不可变值
46
+ * @descEN Validates against mutating props, state, and other immutable values
47
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/immutability
48
+ */
9
49
  "react-hooks/immutability": number;
50
+ /**
51
+ * @desc 禁止使用与记忆化不兼容的库
52
+ * @descEN Validates against usage of libraries which are incompatible with memoization
53
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/incompatible-library
54
+ */
10
55
  "react-hooks/incompatible-library": number;
56
+ /**
57
+ * @desc 验证现有手动的记忆化被编译器保留
58
+ * @descEN Validates that existing manual memoization is preserved by the compiler
59
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/preserve-manual-memoization
60
+ */
11
61
  "react-hooks/preserve-manual-memoization": number;
62
+ /**
63
+ * @desc 验证组件和 hooks 不调用已知的不纯函数
64
+ * @descEN Validates that components/hooks are pure by checking known-impure functions
65
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/purity
66
+ */
12
67
  "react-hooks/purity": number;
68
+ /**
69
+ * @desc 验证 ref 的正确使用,禁止在 render 期间读写 ref.current
70
+ * @descEN Validates correct usage of refs, not reading/writing during render
71
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/refs
72
+ */
13
73
  "react-hooks/refs": number;
74
+ /**
75
+ * @desc 禁止在 effect 中同步调用 setState
76
+ * @descEN Validates against calling setState synchronously in an effect
77
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/set-state-in-effect
78
+ */
14
79
  "react-hooks/set-state-in-effect": number;
80
+ /**
81
+ * @desc 禁止在 render 期间设置状态
82
+ * @descEN Validates against setting state during render
83
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/set-state-in-render
84
+ */
15
85
  "react-hooks/set-state-in-render": number;
86
+ /**
87
+ * @desc 验证组件是静态的,不会在每次 render 时重建
88
+ * @descEN Validates that components are static, not recreated every render
89
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/static-components
90
+ */
16
91
  "react-hooks/static-components": number;
92
+ /**
93
+ * @desc 验证 React Compiler 不支持的语法
94
+ * @descEN Validates against syntax that React Compiler does not support
95
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/unsupported-syntax
96
+ */
17
97
  "react-hooks/unsupported-syntax": number;
98
+ /**
99
+ * @desc 验证 useMemo 回调的使用是否没有返回值
100
+ * @descEN Validates usage of the useMemo hook without a return value
101
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/use-memo
102
+ */
18
103
  "react-hooks/use-memo": number;
19
104
  };
20
105
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"core.reactHooks.d.ts","sourceRoot":"","sources":["../../src/core.reactHooks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,wBAkBE"}
1
+ {"version":3,"file":"core.reactHooks.d.ts","sourceRoot":"","sources":["../../src/core.reactHooks.ts"],"names":[],"mappings":";IACE;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;;AArGL,wBAuGE"}