mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(site): enable eslint-plugin-eslint-comments (#4799)
* chore(site): enable eslint-plugin-eslint-comments * chore: add descriptions to eslint-disable comments * chore: update eslint-disable comments in main.go
This commit is contained in:
@@ -41,9 +41,9 @@ export type AuditDiff = Record<string, AuditDiffField>
|
||||
|
||||
// From codersdk/audit.go
|
||||
export interface AuditDiffField {
|
||||
// eslint-disable-next-line
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed
|
||||
readonly old?: any
|
||||
// eslint-disable-next-line
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed
|
||||
readonly new?: any
|
||||
readonly secret: boolean
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export interface AuditLog {
|
||||
readonly time: string
|
||||
readonly organization_id: string
|
||||
// Named type "net/netip.Addr" unknown, using "any"
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed
|
||||
readonly ip: any
|
||||
readonly user_agent: string
|
||||
readonly resource_type: ResourceType
|
||||
@@ -384,7 +384,7 @@ export interface Healthcheck {
|
||||
export interface License {
|
||||
readonly id: number
|
||||
readonly uploaded_at: string
|
||||
// eslint-disable-next-line
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed
|
||||
readonly claims: Record<string, any>
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ export interface Role {
|
||||
// From codersdk/sse.go
|
||||
export interface ServerSentEvent {
|
||||
readonly type: ServerSentEventType
|
||||
// eslint-disable-next-line
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed
|
||||
readonly data: any
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ const groupBuildsByDate = (builds?: TypesGen.WorkspaceBuild[]) => {
|
||||
builds.forEach((build) => {
|
||||
const dateKey = new Date(build.created_at).toDateString()
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
// Unsure why this is here but we probably need to fix it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- see above
|
||||
if (buildsByDate[dateKey]) {
|
||||
buildsByDate[dateKey].push(build)
|
||||
} else {
|
||||
|
||||
@@ -39,7 +39,7 @@ export const SearchBarWithFilter: React.FC<
|
||||
// debounce query string entry by user
|
||||
// we want the dependency array empty here
|
||||
// as we don't need to redefine the function
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- see above
|
||||
const debouncedOnFilter = useCallback(
|
||||
debounce((debouncedQueryString: string) => {
|
||||
onFilter(debouncedQueryString)
|
||||
|
||||
@@ -41,7 +41,7 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({
|
||||
if (value) {
|
||||
sendSearch("SEARCH", { query: value.email })
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO look into this
|
||||
}, [])
|
||||
|
||||
const handleFilterChange = debounce(
|
||||
|
||||
@@ -47,7 +47,7 @@ const groupAuditLogsByDate = (auditLogs?: AuditLog[]) => {
|
||||
auditLogs.forEach((auditLog) => {
|
||||
const dateKey = new Date(auditLog.time).toDateString()
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- TODO look into this
|
||||
if (auditLogsByDate[dateKey]) {
|
||||
auditLogsByDate[dateKey].push(auditLog)
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises */
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises -- TODO figure out why this is*/
|
||||
import { fireEvent, screen, waitFor } from "@testing-library/react"
|
||||
import userEvent from "@testing-library/user-event"
|
||||
import * as API from "api/api"
|
||||
@@ -62,3 +62,4 @@ describe("CreateWorkspacePage", () => {
|
||||
)
|
||||
})
|
||||
})
|
||||
/* eslint-enable @typescript-eslint/no-floating-promises -- TODO figure out why this is*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises */
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises -- TODO look into this */
|
||||
import { fireEvent, screen, waitFor, within } from "@testing-library/react"
|
||||
import userEvent from "@testing-library/user-event"
|
||||
import EventSourceMock from "eventsourcemock"
|
||||
@@ -349,3 +349,4 @@ describe("WorkspacePage", () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
/* eslint-enable @typescript-eslint/no-floating-promises -- TODO look into this */
|
||||
|
||||
Reference in New Issue
Block a user