Skip to content

Commit

Permalink
style: adapt code to linter
Browse files Browse the repository at this point in the history
  • Loading branch information
hugotiburtino committed Sep 17, 2024
1 parent 119dd9d commit 1bf8fd5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 44 deletions.
34 changes: 0 additions & 34 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,6 @@

// @typescript-eslint/eslint-plugin
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"String": {
"message": "Use string instead",
"fixWith": "string"
},
"Boolean": {
"message": "Use boolean instead",
"fixWith": "boolean"
},
"Number": {
"message": "Use number instead",
"fixWith": "number"
},
"Symbol": {
"message": "Use symbol instead",
"fixWith": "symbol"
},
"Object": {
"message": "Use object instead",
"fixWith": "object"
},
"Function": {
"message": "The `Function` type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape."
},
"{}": {
"message": "`{}` actually means \"any non-nullish value\".\n- If you want a type meaning \"any object\", you probably want `object` instead.\n- If you want a type meaning \"any value\", you probably want `unknown` instead.\n- If you want a type meaning \"empty object\", you probably want `Record<string, never>` instead."
}
},
"extendDefaults": false
}
],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/internals/kratos-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function fetchKratosRegister({
)
}

function fetchKratosSingleLogout(body?: string | undefined) {
function fetchKratosSingleLogout(body?: string) {
return fetch(
bypass(`http://localhost:${port}/kratos/single-logout`, {
method: 'POST',
Expand Down
15 changes: 8 additions & 7 deletions __tests__/schema/subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,18 @@ test('`Subject.unrevisedEntities` shows new revisions first', async () => {
})
.execute()
const subjectsChangedOrder = [...subjects]
;(subjectsChangedOrder[4] = {
subjectsChangedOrder[4] = {
unrevisedEntities: {
nodes: [
{ __typename: 'Article', id: 35247 },
{ __typename: 'Article', id: 34907 },
],
},
}),
await query.shouldReturnData({
subject: {
subjects: subjectsChangedOrder,
},
})
}

await query.shouldReturnData({
subject: {
subjects: subjectsChangedOrder,
},
})
})
2 changes: 1 addition & 1 deletion packages/db-migrations/src/utils/create-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async function changeUuidContents({
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
oldState = JSON.parse(uuid.content)
} catch (e) {
} catch {
// Ignore (some articles have raw text)
continue
}
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/internals/graphql/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as R from 'ramda'
import { ResolversParentTypes } from '~/types'

export interface Schema {
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
resolvers: {}
typeDefs: DocumentNode[]
}
Expand Down

0 comments on commit 1bf8fd5

Please sign in to comment.