Skip to content

Commit

Permalink
Esnlint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian50 committed Oct 27, 2024
1 parent b6ca5ae commit 1fec713
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module.exports = {
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"no-console": ["warn", { allow: ["warn", "error"] }],
},
};
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function App() {
dispatch(setAllWorkersCurrentInstruction(result?.[0]));
dispatch(setPvmInitialized(true));
} catch (e) {
console.log("Error disassembling program", e);
console.error("Error disassembling program", e);
}
},
[dispatch],
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProgramLoader/Assembly.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const Assembly = ({
return;
}
}
console.log(e);
console.error(e);
onProgramLoad(undefined);
setError(`${e}`);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProgramTextLoader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ProgramTextLoader = ({
setProgram(Array.prototype.slice.call(parsedBlob.buffer));
} catch (e) {
console.warn(e);
console.log("wrong binary file");
console.error("wrong binary file");
setIsInvalidProgram(true);
}
} else {
Expand All @@ -37,7 +37,7 @@ export const ProgramTextLoader = ({
setIsInvalidProgram(false);
} catch (e) {
// TODO only validate on submit
console.log("wrong json");
console.error("wrong json");
setIsInvalidProgram(true);
setProgram();
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/PvmSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const fetchWasmMetadata = async (url: string) => {
alert("Invalid URL");
}
} catch (error) {
console.log(error);
console.error(error);
alert("Invalid URL");
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/utils/loggerService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ export const logError = (msg: string, error: unknown) => {
};

export const logInfo = (...msg: unknown[]) => {
// eslint-disable-next-line no-console
console.info("🪵🪵🪵🪵🪵", ...msg);
};

export const logDebug = (...msg: unknown[]) => {
if (process.env.NODE_ENV === "development") {
// eslint-disable-next-line no-console
console.debug("☢️☢️☢️☢️☢️ DEV LOG: \n", ...msg);
}
};

0 comments on commit 1fec713

Please sign in to comment.