Skip to content

Commit

Permalink
Small improvements to tsconfig settings
Browse files Browse the repository at this point in the history
  • Loading branch information
DinerIsmail committed Dec 21, 2024
1 parent e2532cf commit 2d790a3
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/[subdomain]/Web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import useCategoriesPublic from '@hooks/categories/useCategoriesPublic'
import useSelectedWebSlug from '@hooks/application/useSelectedWebSlug'
import useTagsPublic from '@hooks/tags/useTagsPublic'
import { Category } from '@prisma/client'
import type { Category } from '@prisma/client'

const NetworkComponent = dynamic(() => import('@components/network'), {
ssr: false,
Expand Down
3 changes: 2 additions & 1 deletion app/admin/team/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client'
import { Formik, Form, Field, FormikHelpers } from 'formik'
import { Formik, Form, Field } from 'formik'
import type { FormikHelpers } from 'formik'
import { useCallback, useMemo } from 'react'
import { useSession } from 'next-auth/react'
import {
Expand Down
3 changes: 2 additions & 1 deletion app/admin/user-settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'
import { useCallback, useEffect } from 'react'
import { useSession } from 'next-auth/react'
import { Formik, Form, Field, FieldProps } from 'formik'
import { Formik, Form, Field } from 'formik'
import type { FieldProps } from 'formik'
import {
Box,
Center,
Expand Down
3 changes: 2 additions & 1 deletion app/admin/web-settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'
import { useCallback, useEffect } from 'react'
import { Formik, Form, Field, FieldProps } from 'formik'
import { Formik, Form, Field } from 'formik'
import type { FieldProps } from 'formik'
import {
Box,
Center,
Expand Down
2 changes: 1 addition & 1 deletion app/api/categories/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Category } from '@prisma/client'
import type { Category } from '@prisma/client'
import prisma from '@prisma-rw'

export async function GET(request) {
Expand Down
2 changes: 1 addition & 1 deletion app/api/tags/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tag } from '@prisma/client'
import type { Tag } from '@prisma/client'
import prisma from '@prisma-rw'

export async function GET(request) {
Expand Down
3 changes: 2 additions & 1 deletion app/api/webs/[slug]/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Web, Prisma } from '@prisma/client'
import { Prisma } from '@prisma/client'
import type { Web } from '@prisma/client'
import prisma from '@prisma-rw'
import uploadImage from '@helpers/uploadImage'
import { stringToBoolean } from '@helpers/utils'
Expand Down
2 changes: 1 addition & 1 deletion app/edit/[webSlug]/[listingSlug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Metadata } from 'next'
import type { Metadata } from 'next'
import getListing from '../../../[subdomain]/[slug]/getListing'
import EditListing from './EditListing'

Expand Down
5 changes: 3 additions & 2 deletions components/admin/listing-form/ListingForm.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { memo, useEffect, useMemo } from 'react'
import { Formik, Form, Field, FieldProps, useFormikContext } from 'formik'
import { Formik, Form, Field, useFormikContext } from 'formik'
import type { FieldProps } from 'formik'
import ReactSelect from 'react-select'
import type { Options } from 'react-select'
import { Category } from '@prisma/client'
import type { Category } from '@prisma/client'
import NextLink from 'next/link'
import dynamic from 'next/dynamic'
import {
Expand Down
5 changes: 3 additions & 2 deletions components/admin/listing-form/ListingFormSimplified.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { memo, useEffect, useMemo } from 'react'
import { Formik, Form, Field, FieldProps, useFormikContext } from 'formik'
import { Formik, Form, Field, useFormikContext } from 'formik'
import type { FieldProps } from 'formik'
import ReactSelect from 'react-select'
import type { Options } from 'react-select'
import { Category } from '@prisma/client'
import type { Category } from '@prisma/client'
import {
chakra,
Box,
Expand Down
3 changes: 2 additions & 1 deletion components/admin/permissions-list/PermissionsList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { memo, useCallback, useMemo } from 'react'
import { Formik, Form, Field, FieldProps } from 'formik'
import { Formik, Form, Field } from 'formik'
import type { FieldProps } from 'formik'
import isEqual from 'lodash/isEqual'
import { useSession } from 'next-auth/react'
import {
Expand Down
5 changes: 3 additions & 2 deletions components/admin/sidebar/SidebarContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ReactElement, useMemo } from 'react'
import { useMemo } from 'react'
import type { ReactElement } from 'react'
import NextLink from 'next/link'
import Image from 'next/legacy/image'
import { usePathname } from 'next/navigation'
Expand All @@ -8,13 +9,13 @@ import {
CloseButton,
Flex,
Icon,
FlexProps,
Button,
Link,
Stack,
Heading,
Text,
} from '@chakra-ui/react'
import type { FlexProps } from '@chakra-ui/react'
import {
HiViewList,
HiUserGroup,
Expand Down
3 changes: 2 additions & 1 deletion components/admin/web-creation/WebCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
InputRightAddon,
Textarea,
} from '@chakra-ui/react'
import { Formik, Form, Field, FieldProps, useFormikContext } from 'formik'
import { Formik, Form, Field, useFormikContext } from 'formik'
import type { FieldProps } from 'formik'
import LogoImage from '../../../public/logo.png'
import { fieldRequiredValidator, urlValidator } from '@helpers/formValidation'
import useCreateWeb from '@hooks/webs/useCreateWeb'
Expand Down
2 changes: 1 addition & 1 deletion components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
VisuallyHidden,
} from '@chakra-ui/react'
import NextLink from 'next/link'
import { ReactNode } from 'react'
import type { ReactNode } from 'react'
import {
FaGithub,
FaFacebook,
Expand Down
2 changes: 1 addition & 1 deletion hooks/categories/useCategories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query'
import { Category } from '@prisma/client'
import type { Category } from '@prisma/client'
import { useAppContext } from '@store/hooks'

async function fetchCategoriesRequest({ queryKey }) {
Expand Down
2 changes: 1 addition & 1 deletion hooks/categories/useCategoriesPublic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query'
import { Category } from '@prisma/client'
import type { Category } from '@prisma/client'

async function fetchCategoriesRequest({ queryKey }) {
const [_key, { webSlug }] = queryKey
Expand Down
2 changes: 1 addition & 1 deletion hooks/tags/useTags.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query'
import { useAppContext } from '@store/hooks'
import { Tag } from '@prisma/client'
import type { Tag } from '@prisma/client'
import useIsAdminMode from '@hooks/application/useIsAdminMode'

async function fetchTagsRequest({ queryKey }) {
Expand Down
2 changes: 1 addition & 1 deletion hooks/tags/useTagsPublic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query'
import { Tag } from '@prisma/client'
import type { Tag } from '@prisma/client'
import useSelectedWebSlug from '@hooks/application/useSelectedWebSlug'

async function fetchTagsRequest({ queryKey }) {
Expand Down
2 changes: 1 addition & 1 deletion hooks/webs/useCreateWeb.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { Web } from '@prisma/client'
import type { Web } from '@prisma/client'

async function createWebRequest(webData): Promise<{ web: Web }> {
const response = await fetch('/api/webs', {
Expand Down
2 changes: 1 addition & 1 deletion hooks/webs/useUpdateWeb.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { Web } from '@prisma/client'
import type { Web } from '@prisma/client'

async function updateWebRequest(webData) {
const formData = new FormData()
Expand Down
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@
"strict": false,
"forceConsistentCasingInFileNames": true,
"allowImportingTsExtensions": true,
// Make indexing stricter
"noUncheckedIndexedAccess": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"module": "Preserve",
// No accidental global scripts
"moduleDetection": "force",
// Enforced 'type-only' imports
"verbatimModuleSyntax": true,
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
Expand Down

0 comments on commit 2d790a3

Please sign in to comment.