Skip to content

Commit

Permalink
NoImplicitAny rule
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Mar 3, 2023
1 parent eb8bf49 commit 4ffd0e2
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 10 deletions.
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/cors": "^2.8.13",
"@types/jest": "^27.5.2",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
Expand Down
2 changes: 1 addition & 1 deletion src/server/data/questions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const getQuestionData = () => [
const getQuestionData = (): any => [
{
id: 1,
surveyId: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/server/data/results.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const getResultData = () => [
const getResultData = (): any => [
{
id: 1,
surveyId: 1,
Expand Down
4 changes: 2 additions & 2 deletions src/server/db/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const testConnection = async () => {
}

// eslint-disable-next-line no-promise-executor-return
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))

export const connectToDatabase = async (attempt = 0) => {
export const connectToDatabase = async (attempt = 0): Promise<void | null> => {
try {
await testConnection()
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/db/seeders/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import getResultData from '../../data/results'
const seedResults = async () => {
const results: any = getResultData()

results.forEach(async (result) => {
results.forEach(async (result: any) => {
await Result.upsert({
...result,
})
Expand Down
2 changes: 1 addition & 1 deletion src/server/middeware/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Sentry from '@sentry/node'

import logger from '../util/logger'

const errorHandler = (error, _req, _res, next) => {
const errorHandler = (error: any, _req: any, _res: any, next: any) => {
logger.error(`${error.message} ${error.name} ${error.stack}`)

Sentry.captureException(error)
Expand Down
1 change: 1 addition & 0 deletions src/server/middeware/shibboleth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
import headersMiddleware from 'unfuck-utf8-headers-middleware'

const headers = [
Expand Down
2 changes: 1 addition & 1 deletion src/server/middeware/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const mockHeaders = {
hygroupcn: 'grp-toska;hy-mltdk-employees',
}

const userMiddleware = (req, _, next) => {
const userMiddleware = (req: any, _res: any, next: any) => {
const headers = inDevelopment ? mockHeaders : req.headers

const {
Expand Down
2 changes: 1 addition & 1 deletion src/server/util/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (!inProduction) {
})
)
} else {
const levels = {
const levels: { [key: string]: number } = {
error: 0,
warn: 1,
info: 2,
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"declaration": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"noImplicitAny": false,
"noImplicitAny": true,
"lib": ["es2022", "dom"],
"module": "ES2022",
"moduleResolution": "node",
Expand All @@ -13,7 +13,7 @@
"target": "es2022",
"jsx": "react-jsx"
},
// "include": ["src/**/*"],
"include": ["src/**/*", "types/@unfuck-utf8-headers-middleware.d..ts"],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
Expand Down

0 comments on commit 4ffd0e2

Please sign in to comment.