Skip to content

Commit

Permalink
fix: upgrade ts-standard & fit errors (#970)
Browse files Browse the repository at this point in the history
* fix: upgrade ts-standard & fit errors
* fixed all promise errors
  • Loading branch information
vnugent authored Sep 22, 2023
1 parent 98aee1b commit 3e784d2
Show file tree
Hide file tree
Showing 145 changed files with 3,677 additions and 3,823 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ typings/

# Nextjs
.next
next-env.d.ts

# Mac files
.DS_Store
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"standard.treatErrorsAsWarnings": true,
"javascript.format.enable": false,
"javascript.format.semicolons": "remove",
"typescript.format.enable": false
}
"typescript.format.enable": true
}
4 changes: 2 additions & 2 deletions AuthProvider/postLoginAction/setDefaultRoles-step0.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports.onExecutePostLogin = async ({ secrets, user, authorization, stats }, api
clientSecret: secrets.clientSecret,
scope: 'update:roles'
})

const params = { id: user.user_id }
const data = { roles: [EDITOR_ROLE_ID] }

Expand All @@ -41,7 +41,7 @@ exports.onExecutePostLogin = async ({ secrets, user, authorization, stats }, api

const hasEditorRole = authorization?.roles.some(role => role === 'editor') ?? false
if (!hasEditorRole) {
const res = await management.assignRolestoUser(params, data)
await management.assignRolestoUser(params, data)
currentRoles.push('editor')
}
const ns = 'https://tacos.openbeta.io/'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function useSession () {
export function useSession (): any {
return {
status: 'authenticated',
data: {}
Expand Down
4 changes: 2 additions & 2 deletions __mocks__/next/router.js → __mocks__/next/router.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export function useRouter () {
export function useRouter (): any {
return {
route: '/',
pathname: '/',
query: '',
query: {},
asPath: '/',
replace: replaceFn,
push: pushFn,
Expand Down
5 changes: 5 additions & 0 deletions additional.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module '*.png'
declare module '*.jpg'
declare module '*.jpeg'
declare module '*.svg'
declare module '*.gif'
10 changes: 2 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ const createJestConfig = nextJest({

// Add any custom config to be passed to Jest
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
testEnvironment: 'jest-environment-jsdom',

moduleDirectories: ['node_modules', '<rootDir>/'],

moduleNameMapper: {
'@/(.*)$': '<rootDir>/src/$1'
}
setupFilesAfterEnv: ['<rootDir>/src/js/setupTests.ts'],
testEnvironment: 'jest-environment-jsdom'
}

const projectDir = process.cwd()
Expand Down
5 changes: 0 additions & 5 deletions next-env.d.ts

This file was deleted.

36 changes: 16 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
"@radix-ui/react-tabs": "^1.0.1",
"@radix-ui/react-toggle": "^1.0.1",
"@turf/bbox": "^6.5.0",
"@types/underscore": "^1.11.4",
"@types/uuid": "^8.3.4",
"@udecode/zustood": "^1.1.3",
"auth0": "^2.42.0",
"awesome-debounce-promise": "^2.1.0",
Expand All @@ -49,7 +47,6 @@
"next": "12.3.4",
"next-auth": "^4.22.1",
"nprogress": "^0.2.0",
"raw-body": "^2.5.1",
"rc-slider": "^10.0.0-alpha.5",
"react": "^18.0.0",
"react-content-loader": "^6.2.0",
Expand Down Expand Up @@ -82,7 +79,7 @@
],
"license": "AGPL-3.0-or-later",
"scripts": {
"lint": "yarn run ts-standard -p ./tsconfig.json",
"lint": "yarn run ts-standard",
"build": "next build",
"dev": "next dev",
"dev-local": "NEXT_PUBLIC_API_SERVER=http://localhost:4000 yarn dev",
Expand All @@ -96,27 +93,31 @@
"devDependencies": {
"@svgr/webpack": "^6.5.1",
"@tailwindcss/typography": "^0.5.4",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.1.2",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"@types/auth0": "^2.34.19",
"@types/file-saver": "^2.0.5",
"@types/jest": "^29.5.5",
"@types/nanoid-dictionary": "^4.2.0",
"@types/nprogress": "^0.2.0",
"@types/react": "^18.0.9",
"@types/react-beautiful-dnd": "^13.1.0",
"@types/underscore": "^1.11.9",
"@types/uuid": "^9.0.4",
"autoprefixer": "^10.4.1",
"eslint-plugin-jest": "^27.1.4",
"husky": "^7.0.4",
"jest": "29.0.3",
"jest-environment-jsdom": "^29.2.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"postcss": "^8.4.16",
"postcss-import": "^14.1.0",
"react-test-renderer": "^18.0.0",
"resize-observer-polyfill": "^1.5.1",
"tailwindcss": "^3.1.8",
"ts-standard": "11.0.0",
"typescript": "4.9.5"
"ts-standard": "^12.0.2",
"typescript": "^5.2.2"
},
"repository": {
"type": "git",
Expand All @@ -126,22 +127,17 @@
"url": "https://github.com/OpenBeta/open-tacos/issues"
},
"ts-standard": {
"project": "./tsconfig.json",
"ignore": [
"build",
"node_modules/**"
],
"plugins": [
"jest"
],
"envs": {
"environment": {
"browser": true,
"es2021": true
},
"files": [
"src/**/*.js",
"src/**/*.ts",
"src/**/*.tsx"
]
"jest/globals": true
}
},
"engines": {
"node": "18"
Expand Down
3 changes: 0 additions & 3 deletions setupTests.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/assets/icons/cc-icons/by.svg

This file was deleted.

27 changes: 0 additions & 27 deletions src/assets/icons/cc-icons/cc.svg

This file was deleted.

14 changes: 0 additions & 14 deletions src/assets/icons/cc-icons/index.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/assets/icons/cc-icons/nc-eu.svg

This file was deleted.

18 changes: 0 additions & 18 deletions src/assets/icons/cc-icons/nc-jp.svg

This file was deleted.

23 changes: 0 additions & 23 deletions src/assets/icons/cc-icons/nc.svg

This file was deleted.

18 changes: 0 additions & 18 deletions src/assets/icons/cc-icons/nd.svg

This file was deleted.

24 changes: 0 additions & 24 deletions src/assets/icons/cc-icons/pd.svg

This file was deleted.

20 changes: 0 additions & 20 deletions src/assets/icons/cc-icons/remix.svg

This file was deleted.

Loading

1 comment on commit 3e784d2

@vercel
Copy link

@vercel vercel bot commented on 3e784d2 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.