small linter-related fixes

This commit is contained in:
f0x 2023-01-18 13:06:21 +00:00
parent 2362c0627f
commit 981159b1d8
8 changed files with 6 additions and 15 deletions
web/source
package.json
settings
admin/emoji/local
components
lib

View file

@ -6,7 +6,7 @@
"author": "f0x",
"license": "AGPL-3.0",
"scripts": {
"lint": "eslint .",
"lint": "eslint . --ext .js,.jsx",
"build": "node index.js",
"dev": "NODE_ENV=development node index.js"
},
@ -53,4 +53,4 @@
"postcss-nested": "^6.0.0",
"uglifyify": "^5.0.2"
}
}
}

View file

@ -80,8 +80,6 @@ function EmojiDetailForm({ data: emoji }) {
return <Redirect to={base} />;
}
console.log(form.category);
return (
<>
<div className="emoji-header">

View file

@ -30,10 +30,7 @@ const Loading = require("../loading");
module.exports = function Login({ }) {
const form = {
instance: useTextInput("instance", {
defaultValue: window.location.origin,
validator: (value) => {
return "";
}
defaultValue: window.location.origin
}),
scopes: useValue("scopes", "user admin")
};

View file

@ -44,7 +44,8 @@ function ErrorFallback({ error, resetErrorBoundary }) {
}
function Error({ error }) {
console.error("Rendering:", error);
/* eslint-disable-next-line no-console */
console.error("Rendering error:", error);
let message;
if (error.data != undefined) { // RTK Query error with data

View file

@ -25,9 +25,6 @@ module.exports = function MutationButton({ label, result, disabled, showError =
let iconClass = "";
const targetsThisButton = result.action == inputProps.name; // can also both be undefined, which is correct
/* FIXME? submitting an unchanged form will never transition to isLoading,
and check icon will stay faded out because the css animation doesn't restart
*/
if (targetsThisButton) {
if (result.isLoading) {
iconClass = "fa-spin fa-refresh";

View file

@ -59,7 +59,7 @@ function updateState(state, key, newValue) {
};
}
module.exports = function useCheckListInput({ name, Name }, { entries, uniqueKey = "key", defaultValue = false }) {
module.exports = function useCheckListInput({ name }, { entries, uniqueKey = "key", defaultValue = false }) {
const [state, setState] = React.useState({});
const [someSelected, setSomeSelected] = React.useState(false);

View file

@ -151,7 +151,6 @@ module.exports = (build) => ({
}).then((res) => {
data.push([emoji.shortcode, res]);
}).catch((e) => {
console.error("emoji", action, "for", emoji.shortcode, "failed:", e);
let msg = e.message ?? e;
if (e.data.error) {
msg = e.data.error;

View file

@ -138,7 +138,6 @@ const endpoints = (build) => ({
url.searchParams.set("scope", app.scopes);
let redirectURL = url.toString();
console.log("OAUTH redirect to:", redirectURL);
window.location.assign(redirectURL);
return { data: null };