-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlint.log
More file actions
91 lines (71 loc) · 12.1 KB
/
Copy pathlint.log
File metadata and controls
91 lines (71 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
> ledgera@0.1.0 lint
> eslint
D:\Github\Decentralized-Supply-Chain-Orchestrator\_archive\NewFrontend\DISCO\src\components\AgentFlow.jsx
19:9 error Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
17 | const stageIndex = agents.findIndex(a => a.name === currentStage);
18 | if (stageIndex !== -1) {
> 19 | setActiveStage(stageIndex);
| ^^^^^^^^^^^^^^ Avoid calling setState() directly within an effect
20 | }
21 | } else {
22 | // Auto-animate through stages for demo react-hooks/set-state-in-effect
28:6 warning React Hook useEffect has a missing dependency: 'agents'. Either include it or remove the dependency array react-hooks/exhaustive-deps
D:\Github\Decentralized-Supply-Chain-Orchestrator\_archive\NewFrontend\DISCO\src\components\ThreeTruck.jsx
84:18 warning The ref value 'mountRef.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'mountRef.current' to a variable inside the effect, and use that variable in the cleanup function react-hooks/exhaustive-deps
D:\Github\Decentralized-Supply-Chain-Orchestrator\_archive\NewFrontend\DISCO\src\hooks\useWebSocket.js
43:21 error Error: Cannot access variable before it is declared
`connect` is accessed before it is declared, which prevents the earlier access from updating when this value changes over time.
41 | reconnectTimeoutRef.current = setTimeout(() => {
42 | console.log('Attempting to reconnect...');
> 43 | connect();
| ^^^^^^^ `connect` accessed before it is declared
44 | }, 3000);
45 | };
46 |
9 | const reconnectTimeoutRef = useRef(null);
10 |
> 11 | const connect = useCallback(() => {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 12 | try {
| ^^^^^^^^^^^^^
> 13 | const ws = createWebSocket(path);
…
| ^^^^^^^^^^^^^
> 51 | }
| ^^^^^^^^^^^^^
> 52 | }, [path]);
| ^^^^^^^^^^^^^^^^ `connect` is declared here
53 |
54 | const disconnect = useCallback(() => {
55 | if (reconnectTimeoutRef.current) { react-hooks/immutability
D:\Github\Decentralized-Supply-Chain-Orchestrator\_archive\NewFrontend\DISCO\src\pages\AnalyticsPage.jsx
12:8 warning React Hook useEffect has a missing dependency: 'fetchBlockchain'. Either include it or remove the dependency array react-hooks/exhaustive-deps
D:\Github\Decentralized-Supply-Chain-Orchestrator\_archive\NewFrontend\DISCO\src\pages\OrderPage.jsx
9:26 error Error: Cannot call impure function during render
`Date.now` is an impure function. Calling an impure function can produce unstable results that update unpredictably when the component happens to re-render. (https://react.dev/reference/rules/components-and-hooks-must-be-pure#components-and-hooks-must-be-idempotent).
7 | const { createOrder, loading } = useApp();
8 | const [formData, setFormData] = useState({
> 9 | order_id: `ORD-${Date.now()}`,
| ^^^^^^^^^^ Cannot call impure function
10 | product: '',
11 | quantity: 1,
12 | destination: '', react-hooks/purity
D:\Github\Decentralized-Supply-Chain-Orchestrator\_archive\NewFrontend\DISCO\src\pages\TrackingPage.jsx
15:13 error Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
13 | useEffect(() => {
14 | if (lastMessage) {
> 15 | setTrackingData(prev => [...prev, lastMessage]);
| ^^^^^^^^^^^^^^^ Avoid calling setState() directly within an effect
16 |
17 | if (lastMessage.stage) {
18 | setCurrentStage(lastMessage.stage); react-hooks/set-state-in-effect
Γ£û 7 problems (4 errors, 3 warnings)