Skip to content

Commit e564b24

Browse files
committed
Proposal: Changing some linting rules, making some fixes
1 parent c7cb0b8 commit e564b24

File tree

16 files changed

+34
-34
lines changed

16 files changed

+34
-34
lines changed

app/web/eslint.config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ export default defineConfigWithVueTs(
7474
// dont want this
7575
"@typescript-eslint/consistent-type-imports": 0,
7676
"import/named": 0,
77-
78-
// warning on this because we have some shenanigans where it is a promise but a literal `await` is not present
79-
"@typescript-eslint/require-await": "warn",
77+
"@typescript-eslint/require-await": 0,
8078

8179
// "prettier/prettier": "warn",
8280
"@typescript-eslint/quotes": 0,
@@ -103,10 +101,11 @@ export default defineConfigWithVueTs(
103101
"no-await-in-loop": 0,
104102
"no-lonely-if": 0,
105103
"@typescript-eslint/no-unused-vars": [
106-
"warn",
104+
"error",
107105
{
108106
argsIgnorePattern: "^_|^(response)$",
109107
varsIgnorePattern: "^_|^(props|emit)$",
108+
caughtErrorsIgnorePattern: "^_",
110109
},
111110
],
112111
"@typescript-eslint/return-await": 0,
@@ -116,7 +115,7 @@ export default defineConfigWithVueTs(
116115
// curly: ["error", "multi-line"],
117116
// "brace-style": "error",
118117
"max-len": [
119-
"warn", // just a warning since prettier will enforce
118+
"off", // prettier will enforce
120119
120,
121120
2,
122121
{
@@ -167,9 +166,9 @@ export default defineConfigWithVueTs(
167166
"@typescript-eslint/no-shadow": 0,
168167
"guard-for-in": 0,
169168

169+
"no-console": "error",
170170
// some rules to downgrade to warning while developing --------------------
171171
// useful so things dont crash when code is temporarily commented out
172-
"no-console": "warn",
173172
"@typescript-eslint/no-empty-function": "warn",
174173
"no-debugger": "warn",
175174
"no-alert": "warn",
@@ -192,6 +191,12 @@ export default defineConfigWithVueTs(
192191
// useful while debugging and commenting things out, otherwise gets automatically changed from let to const
193192
// "no-autofix/prefer-const": "warn",
194193

194+
// not clear to me why we have these problems
195+
"import/no-named-as-default": 0,
196+
"import/no-named-as-default-member": 0,
197+
198+
"@typescript-eslint/no-empty-function": 0,
199+
195200
"vue/block-order": [
196201
"error",
197202
{

app/web/src/components/CachedAppNotification.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function check() {
5454
if (runningHash && latestHash !== runningHash) {
5555
openModal();
5656
}
57-
} catch (err) {
57+
} catch (_err) {
5858
// local dev errors here because the manifest file doesn't exist
5959
stopInterval();
6060
}

app/web/src/newhotness/FuncRunDetails.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const functionCode = computed<string>(() => {
289289
try {
290290
const decodedCode = atob(funcRun.value.functionCodeBase64);
291291
return decodedCode;
292-
} catch (e) {
292+
} catch (_e) {
293293
return "// Error decoding function code";
294294
}
295295
});
@@ -300,7 +300,7 @@ const argsJson = computed<string>(() => {
300300
301301
try {
302302
return JSON.stringify(funcRun.value.functionArgs, null, 2);
303-
} catch (e) {
303+
} catch (_e) {
304304
return "// Error formatting arguments";
305305
}
306306
});
@@ -311,7 +311,7 @@ const resultJson = computed<string>(() => {
311311
312312
try {
313313
return JSON.stringify(funcRun.value.resultValue, null, 2);
314-
} catch (e) {
314+
} catch (_e) {
315315
return "// Error formatting result";
316316
}
317317
});

app/web/src/newhotness/LatestFuncRunDetails.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const functionCode = computed(() => actionDetailQuery.data.value?.code);
104104
const argsJson = computed(() => {
105105
try {
106106
return JSON.stringify(actionDetailQuery.data.value?.args, null, 2);
107-
} catch (e) {
107+
} catch (_e) {
108108
return "// Error formatting arguments";
109109
}
110110
});

app/web/src/newhotness/Review.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ const restoreComponent = async () => {
971971
await sleep(1000);
972972
const result = await restoreComponents([selectedComponent.value.id]);
973973
restoreComponentStatus.value = result.success ? "succeeded" : undefined;
974-
} catch (e) {
974+
} catch (_e) {
975975
restoreComponentStatus.value = undefined;
976976
}
977977
};

app/web/src/newhotness/StatusPanel.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const STATUS_PANEL_KEY = "statusPanel";
8888
realtimeStore.subscribe(STATUS_PANEL_KEY, `workspace/${ctx.workspacePk.value}`, [
8989
{
9090
eventType: "ChangeSetStatusChanged",
91-
callback: async (data) => {
91+
callback: (data) => {
9292
if (
9393
[ChangeSetStatus.Abandoned, ChangeSetStatus.Applied, ChangeSetStatus.Closed].includes(data.changeSet.status) &&
9494
data.changeSet.id !== ctx.headChangeSetId.value
@@ -102,7 +102,7 @@ realtimeStore.subscribe(STATUS_PANEL_KEY, `workspace/${ctx.workspacePk.value}`,
102102
},
103103
{
104104
eventType: "ManagementOperationsComplete",
105-
callback: async (payload, meta) => {
105+
callback: (payload, meta) => {
106106
if (!payload.requestUlid) return;
107107
const key = `management-${payload.requestUlid}`;
108108
if (superBucket[meta.change_set_id]?.[key]) {
@@ -113,7 +113,7 @@ realtimeStore.subscribe(STATUS_PANEL_KEY, `workspace/${ctx.workspacePk.value}`,
113113
},
114114
{
115115
eventType: "ManagementOperationsFailed",
116-
callback: async (payload, meta) => {
116+
callback: (payload, meta) => {
117117
// BUCKET ITEM -- ADD -- MANAGEMENT FUNCS
118118
const key = `management-${payload.requestUlid}`;
119119
let bucket = superBucket[meta.change_set_id];
@@ -126,7 +126,7 @@ realtimeStore.subscribe(STATUS_PANEL_KEY, `workspace/${ctx.workspacePk.value}`,
126126
},
127127
{
128128
eventType: "ManagementOperationsInProgress",
129-
callback: async (payload, meta) => {
129+
callback: (payload, meta) => {
130130
// BUCKET ITEM -- ADD -- MANAGEMENT FUNCS
131131
const key = `management-${payload.requestUlid}`;
132132
let bucket = superBucket[meta.change_set_id];

app/web/src/newhotness/logic_composables/rainbow_counter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const useRainbow = (changeSetId: ComputedRef<ChangeSetId>) => {
2626
* When its > 0 the system is waiting for data
2727
*/
2828
return { count: computed(() => queue?.size ?? 0) };
29-
} catch (err) {
29+
} catch (_err) {
3030
return { count: 0 };
3131
}
3232
});

app/web/src/newhotness/logic_composables/watched_form.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const useWatchedForm = <Data extends Record<string, string>>(label: strin
130130
try {
131131
await onSubmit(props);
132132
hasSubmitted = true;
133-
} catch (e) {
133+
} catch (_e) {
134134
// TODO report errors and display on caller forms
135135
// Cancel the spinner and bifrosting on failure
136136
markComplete();

app/web/src/store/auth.store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export const useAuthStore = () => {
292292
},
293293
});
294294
}
295-
} catch (error) {
295+
} catch (_error) {
296296
// Silently fail - logout will still clear local state
297297
}
298298

app/web/src/store/realtime/heimdall.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,17 +320,13 @@ db.getConnections().then((conns) => {
320320
});
321321
});
322322

323-
const updateConnectionStatus: ConnStatusFn = async (
324-
workspaceId: WorkspacePk,
325-
connected: boolean,
326-
noBroadcast?: boolean,
327-
) => {
323+
const updateConnectionStatus: ConnStatusFn = (workspaceId: WorkspacePk, connected: boolean, noBroadcast?: boolean) => {
328324
_wsConnections.value[workspaceId] = connected;
329325

330326
// always update to connected
331327
if (connected) wsConnections.value[workspaceId] = connected;
332328

333-
await db.setConnections({ ..._wsConnections.value });
329+
db.setConnections({ ..._wsConnections.value });
334330

335331
// prevent blips in the UI from quick disconnect -> connect flips
336332
setTimeout(() => {
@@ -691,7 +687,7 @@ const fetchOpenChangeSets = async (workspaceId: WorkspacePk): Promise<WorkspaceM
691687
url: `v2/workspaces/${workspaceId}/change-sets`,
692688
});
693689
return resp.data;
694-
} catch (err) {
690+
} catch (_err) {
695691
return {
696692
name: "",
697693
id: "",

0 commit comments

Comments
 (0)