Unverified Commit 69d42ae9 authored by Bowen Liang's avatar Bowen Liang Committed by GitHub

fix: cover missed source paths for eslint (#1956)

parent 5ff701ca
...@@ -10,20 +10,21 @@ export type WorkspacesContextValue = { ...@@ -10,20 +10,21 @@ export type WorkspacesContextValue = {
} }
const WorkspacesContext = createContext<WorkspacesContextValue>({ const WorkspacesContext = createContext<WorkspacesContextValue>({
workspaces: [] workspaces: [],
}) })
interface IWorkspaceProviderProps { type IWorkspaceProviderProps = {
children: React.ReactNode children: React.ReactNode
} }
export const WorkspaceProvider = ({ export const WorkspaceProvider = ({
children children,
}: IWorkspaceProviderProps) => { }: IWorkspaceProviderProps) => {
const { data } = useSWR({ url: '/workspaces' }, fetchWorkspaces) const { data } = useSWR({ url: '/workspaces' }, fetchWorkspaces)
return ( return (
<WorkspacesContext.Provider value={{ <WorkspacesContext.Provider value={{
workspaces: data?.workspaces || [] workspaces: data?.workspaces || [],
}}> }}>
{children} {children}
</WorkspacesContext.Provider> </WorkspacesContext.Provider>
......
This diff is collapsed.
import { createInstance } from 'i18next' import { createInstance } from 'i18next'
import resourcesToBackend from 'i18next-resources-to-backend' import resourcesToBackend from 'i18next-resources-to-backend'
import { initReactI18next } from 'react-i18next/initReactI18next' import { initReactI18next } from 'react-i18next/initReactI18next'
import { Locale } from '.' import type { Locale } from '.'
// https://locize.com/blog/next-13-app-dir-i18n/ // https://locize.com/blog/next-13-app-dir-i18n/
const initI18next = async (lng: Locale, ns: string) => { const initI18next = async (lng: Locale, ns: string) => {
...@@ -21,6 +21,6 @@ export async function useTranslation(lng: Locale, ns = '', options: Record<strin ...@@ -21,6 +21,6 @@ export async function useTranslation(lng: Locale, ns = '', options: Record<strin
const i18nextInstance = await initI18next(lng, ns) const i18nextInstance = await initI18next(lng, ns)
return { return {
t: i18nextInstance.getFixedT(lng, ns, options.keyPrefix), t: i18nextInstance.getFixedT(lng, ns, options.keyPrefix),
i18n: i18nextInstance i18n: i18nextInstance,
} }
} }
import { Locale } from '@/i18n' import type { Locale } from '@/i18n'
export type ResponseHolder = {} export type ResponseHolder = {}
...@@ -6,7 +6,7 @@ export type ConversationItem = { ...@@ -6,7 +6,7 @@ export type ConversationItem = {
id: string id: string
name: string name: string
inputs: Record<string, any> | null inputs: Record<string, any> | null
introduction: string, introduction: string
} }
export type SiteInfo = { export type SiteInfo = {
......
...@@ -24,6 +24,7 @@ const nextConfig = { ...@@ -24,6 +24,7 @@ const nextConfig = {
// Warning: This allows production builds to successfully complete even if // Warning: This allows production builds to successfully complete even if
// your project has ESLint errors. // your project has ESLint errors.
ignoreDuringBuilds: true, ignoreDuringBuilds: true,
dirs: ['app', 'bin', 'config', 'context', 'hooks', 'i18n', 'models', 'service', 'test', 'types', 'utils'],
}, },
typescript: { typescript: {
// https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors // https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
......
...@@ -61,6 +61,6 @@ export const seedLog = () => { ...@@ -61,6 +61,6 @@ export const seedLog = () => {
}, },
get adminRate() { get adminRate() {
return faker.datatype.number(5) return faker.datatype.number(5)
} },
}) })
} }
...@@ -2,8 +2,7 @@ import { Model, createServer } from 'miragejs' ...@@ -2,8 +2,7 @@ import { Model, createServer } from 'miragejs'
import type { User } from '@/models/user' import type { User } from '@/models/user'
import type { History } from '@/models/history' import type { History } from '@/models/history'
import type { Log } from '@/models/log' import type { Log } from '@/models/log'
import { seedUser, seedHistory, seedLog } from '@/test/factories' import { seedHistory, seedLog, seedUser } from '@/test/factories'
export function mockAPI() { export function mockAPI() {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment