Skip to content

Commit 5727a88

Browse files
Fixed immediately fixable rules, and TODO-diabled the rest
1 parent c1bf93a commit 5727a88

File tree

7 files changed

+28
-12
lines changed

7 files changed

+28
-12
lines changed

site/.eslintrc.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,26 @@ rules:
3737
"@typescript-eslint/brace-style":
3838
["error", "1tbs", { "allowSingleLine": false }]
3939
"@typescript-eslint/method-signature-style": ["error", "property"]
40+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
41+
"@typescript-eslint/no-misused-promises": "off"
42+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
43+
"@typescript-eslint/no-unsafe-argument": "off"
44+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
45+
"@typescript-eslint/no-unsafe-assignment": "off"
46+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
47+
"@typescript-eslint/no-unsafe-call": "off"
48+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
49+
"@typescript-eslint/no-unsafe-member-access": "off"
50+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
51+
"@typescript-eslint/no-unsafe-return": "off"
52+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
53+
"@typescript-eslint/require-await": "off"
54+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
55+
"@typescript-eslint/restrict-plus-operands": "off"
56+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
57+
"@typescript-eslint/restrict-template-expressions": "off"
58+
# TODO: Investigate whether to enable this rule & fix and/or disable all its complaints
59+
"@typescript-eslint/unbound-method": "off"
4060
# We're disabling the `no-namespace` rule to use a pattern of defining an interface,
4161
# and then defining functions that operate on that data via namespace. This is helpful for
4262
# dealing with immutable objects. This is a common pattern that shows up in some other

site/src/api/api.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export const hardCodedCSRFCookie = (): string => {
2020
export const withDefaultFeatures = (
2121
fs: Partial<TypesGen.Entitlements["features"]>,
2222
): TypesGen.Entitlements["features"] => {
23-
for (const k in TypesGen.FeatureNames) {
24-
const feature = k as TypesGen.FeatureName
23+
for (const feature of TypesGen.FeatureNames) {
2524
// Skip fields that are already filled.
2625
if (fs[feature] !== undefined) {
2726
continue
@@ -152,8 +151,7 @@ export const getTokens = async (): Promise<TypesGen.APIKey[]> => {
152151
}
153152

154153
export const deleteAPIKey = async (keyId: string): Promise<void> => {
155-
const response = await axios.delete("/api/v2/users/me/keys/" + keyId)
156-
return response.data
154+
await axios.delete("/api/v2/users/me/keys/" + keyId)
157155
}
158156

159157
export const getUsers = async (

site/src/components/LicenseBanner/LicenseBanner.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Language } from "./LicenseBannerView"
99
describe("LicenseBanner", () => {
1010
it("does not show when there are no warnings", async () => {
1111
render(<LicenseBanner />)
12-
const bannerPillSingular = await screen.queryByText(Language.licenseIssue)
13-
const bannerPillPlural = await screen.queryByText(Language.licenseIssues(2))
12+
const bannerPillSingular = screen.queryByText(Language.licenseIssue)
13+
const bannerPillPlural = screen.queryByText(Language.licenseIssues(2))
1414
expect(bannerPillSingular).toBe(null)
1515
expect(bannerPillPlural).toBe(null)
1616
})

site/src/pages/TemplateSettingsPage/TemplateSettingsPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const fillAndSubmitForm = async ({
6565
await userEvent.clear(maxTtlField)
6666
await userEvent.type(maxTtlField, default_ttl_ms.toString())
6767

68-
const allowCancelJobsField = await screen.getByRole("checkbox")
68+
const allowCancelJobsField = screen.getByRole("checkbox")
6969
// checkbox is checked by default, so it must be clicked to get unchecked
7070
if (!allow_user_cancel_workspace_jobs) {
7171
await userEvent.click(allowCancelJobsField)

site/src/pages/UsersPage/UsersPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ describe("UsersPage", () => {
255255
expect(API.getUsers).toBeCalledWith({ offset: 0, limit: 25, q: "" }),
256256
)
257257

258-
const pageButtons = await container.querySelectorAll(
258+
const pageButtons = container.querySelectorAll(
259259
`button[name="Page button"]`,
260260
)
261261
// count handler says there are 2 pages of results

site/src/pages/WorkspacesPage/WorkspacesPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe("WorkspacesPage", () => {
4949
name: "Previous page",
5050
})
5151
expect(prevPage).toBeDisabled()
52-
const pageButtons = await container.querySelectorAll(
52+
const pageButtons = container.querySelectorAll(
5353
`button[name="Page button"]`,
5454
)
5555
expect(pageButtons.length).toBe(2)

site/src/xServices/users/searchUserXService.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ export const searchUserMachine = createMachine(
5151
{
5252
services: {
5353
searchUsers: async (_, { query }) =>
54-
await (
55-
await getUsers(queryToFilter(query))
56-
).users,
54+
(await getUsers(queryToFilter(query))).users,
5755
},
5856
actions: {
5957
assignSearchResults: assign({

0 commit comments

Comments
 (0)