File tree 9 files changed +44
-7
lines changed
9 files changed +44
-7
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ export default tseslint.config(
23
23
'warn' ,
24
24
{ allowConstantExport : true } ,
25
25
] ,
26
+ '@typescript-eslint/no-unused-expressions' : [
27
+ 'error' ,
28
+ {
29
+ allowShortCircuit : true ,
30
+ allowTernary : true ,
31
+ allowTaggedTemplates : true ,
32
+ } ,
33
+ ] ,
26
34
} ,
27
35
} ,
28
36
) ;
Original file line number Diff line number Diff line change 6
6
"scripts" : {
7
7
"dev" : " vite" ,
8
8
"build" : " tsc -b && vite build" ,
9
- "lint" : " eslint ." ,
9
+ "lint" : " eslint --fix ." ,
10
10
"preview" : " vite preview"
11
11
},
12
12
"dependencies" : {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { ExplorerObject } from './components/ExplorerObject';
11
11
import { ExplorerPackage } from './components/ExplorerPackage' ;
12
12
import { Workspace } from './components/Workspace' ;
13
13
import { COMMENDS } from './utilities/commends' ;
14
- import { STATE } from './recoil' ;
14
+ import { IAccount , STATE } from './recoil' ;
15
15
16
16
function App ( ) {
17
17
const initialized = useRef < boolean > ( false ) ;
@@ -20,7 +20,15 @@ function App() {
20
20
const [ state , setState ] = useRecoilState ( STATE ) ;
21
21
22
22
useEffect ( ( ) => {
23
- const handleMessage = async ( event : any ) => {
23
+ const handleMessage = async (
24
+ event : MessageEvent < {
25
+ command : COMMENDS ;
26
+ data : {
27
+ hasTerminal : boolean ;
28
+ account ?: IAccount ;
29
+ } ;
30
+ } > ,
31
+ ) => {
24
32
const message = event . data ;
25
33
switch ( message . command ) {
26
34
case COMMENDS . Env :
Original file line number Diff line number Diff line change @@ -85,7 +85,12 @@ export const Account = ({ client }: { client: SuiClient | undefined }) => {
85
85
setState ( ( oldState ) => ( { ...oldState , balance } ) ) ;
86
86
} ;
87
87
88
- const handleMessage = async ( event : any ) => {
88
+ const handleMessage = async (
89
+ event : MessageEvent < {
90
+ command : COMMENDS ;
91
+ data : string ;
92
+ } > ,
93
+ ) => {
89
94
const message = event . data ;
90
95
switch ( message . command ) {
91
96
case COMMENDS . LoginJwt :
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export const ExplorerOwnerObjects = ({
119
119
const handleNext = async () => {
120
120
if (currentPage < objectsInfo.length - 1) {
121
121
setCurrentPage(currentPage + 1);
122
- } else if (!! next) {
122
+ } else if (next) {
123
123
await loadOwnerObjecs(next);
124
124
setCurrentPage(currentPage + 1);
125
125
}
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ export const Function = ({
130
130
) => {
131
131
try {
132
132
setIsLoading(true);
133
- let errors: boolean[] = [...new Array(inputValues.length).fill(false)];
133
+ const errors: boolean[] = [...new Array(inputValues.length).fill(false)];
134
134
for (let i = 0; i < inputValues.length; i++) {
135
135
if (state.account) {
136
136
const filtered = deleteTxContext(func);
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export const signAndExcute = async (
46
46
digest,
47
47
options : { showObjectChanges : true } ,
48
48
} ) ;
49
- if ( ! ! res . errors ) {
49
+ if ( res . errors ) {
50
50
vscode . postMessage ( {
51
51
command : COMMENDS . MsgError ,
52
52
data : `error: ${ res . errors . toString ( ) } ` ,
Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ export default tseslint.config(
23
23
'warn' ,
24
24
{ allowConstantExport : true } ,
25
25
] ,
26
+ '@typescript-eslint/no-unused-expressions' : [
27
+ 'error' ,
28
+ {
29
+ allowShortCircuit : true ,
30
+ allowTernary : true ,
31
+ allowTaggedTemplates : true ,
32
+ } ,
33
+ ] ,
26
34
} ,
27
35
} ,
28
36
) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ export default tseslint.config(
23
23
'warn' ,
24
24
{ allowConstantExport : true } ,
25
25
] ,
26
+ '@typescript-eslint/no-unused-expressions' : [
27
+ 'error' ,
28
+ {
29
+ allowShortCircuit : true ,
30
+ allowTernary : true ,
31
+ allowTaggedTemplates : true ,
32
+ } ,
33
+ ] ,
26
34
} ,
27
35
} ,
28
36
) ;
You can’t perform that action at this time.
0 commit comments