Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth committed Jan 3, 2025
1 parent a5a0d53 commit f2b7af9
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/webview/activitybar/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export default tseslint.config(
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
},
},
);
2 changes: 1 addition & 1 deletion src/webview/activitybar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint": "eslint --fix .",
"preview": "vite preview"
},
"dependencies": {
Expand Down
12 changes: 10 additions & 2 deletions src/webview/activitybar/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ExplorerObject } from './components/ExplorerObject';
import { ExplorerPackage } from './components/ExplorerPackage';
import { Workspace } from './components/Workspace';
import { COMMENDS } from './utilities/commends';
import { STATE } from './recoil';
import { IAccount, STATE } from './recoil';

function App() {
const initialized = useRef<boolean>(false);
Expand All @@ -20,7 +20,15 @@ function App() {
const [state, setState] = useRecoilState(STATE);

useEffect(() => {
const handleMessage = async (event: any) => {
const handleMessage = async (
event: MessageEvent<{
command: COMMENDS;
data: {
hasTerminal: boolean;
account?: IAccount;
};
}>,
) => {
const message = event.data;
switch (message.command) {
case COMMENDS.Env:
Expand Down
7 changes: 6 additions & 1 deletion src/webview/activitybar/src/components/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ export const Account = ({ client }: { client: SuiClient | undefined }) => {
setState((oldState) => ({ ...oldState, balance }));
};

const handleMessage = async (event: any) => {
const handleMessage = async (
event: MessageEvent<{
command: COMMENDS;
data: string;
}>,
) => {
const message = event.data;
switch (message.command) {
case COMMENDS.LoginJwt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const ExplorerOwnerObjects = ({
const handleNext = async () => {
if (currentPage < objectsInfo.length - 1) {
setCurrentPage(currentPage + 1);
} else if (!!next) {
} else if (next) {
await loadOwnerObjecs(next);
setCurrentPage(currentPage + 1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/webview/activitybar/src/components/Function.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const Function = ({
) => {
try {
setIsLoading(true);
let errors: boolean[] = [...new Array(inputValues.length).fill(false)];
const errors: boolean[] = [...new Array(inputValues.length).fill(false)];
for (let i = 0; i < inputValues.length; i++) {
if (state.account) {
const filtered = deleteTxContext(func);
Expand Down
2 changes: 1 addition & 1 deletion src/webview/activitybar/src/utilities/signAndExcute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const signAndExcute = async (
digest,
options: { showObjectChanges: true },
});
if (!!res.errors) {
if (res.errors) {
vscode.postMessage({
command: COMMENDS.MsgError,
data: `error: ${res.errors.toString()}`,
Expand Down
8 changes: 8 additions & 0 deletions src/webview/panel/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export default tseslint.config(
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
},
},
);
8 changes: 8 additions & 0 deletions src/webview/ptb-builder/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export default tseslint.config(
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
},
},
);

0 comments on commit f2b7af9

Please sign in to comment.