-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: upgrade typescript + prettier + eslint with a single shared linting config #424
Changes from 11 commits
43e1eec
f1f2fd9
61e2fd7
9210246
18812d2
b9ece78
b4aa386
ef3f6e1
8dd982f
add0c82
2067cd7
5b6d0eb
283bf67
af4ecbc
ad92c5a
f83eab2
d0090c7
efc69ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
extends: ["eslint-config-custom"], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: [ | ||
"./tsconfig.json", | ||
"./apps/*/tsconfig.json", | ||
"./packages/*/tsconfig.json", | ||
], | ||
project: __dirname + "/tsconfig.json", | ||
}, | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,20 +7,21 @@ | |
"build:dev": "pnpm with-env next build", | ||
"check": "tsc --noEmit", | ||
"clean": "rm -rf .next .turbo node_modules", | ||
"dev": "FORCE_COLOR=1 SENTRY_SUPPRESS_TURBOPACK_WARNING=1 pnpm with-env node scripts/increase-listeners.js next dev --port 2525 --turbo | pino-pretty -C", | ||
"dev:sentry": "FORCE_COLOR=1 pnpm with-env node scripts/increase-listeners.js next dev --port 2525 | pino-pretty -C", | ||
"dev": "FORCE_COLOR=1 SENTRY_SUPPRESS_TURBOPACK_WARNING=1 pnpm with-env next dev --port 2525 --turbo | pino-pretty -C", | ||
"dev:sentry": "FORCE_COLOR=1 pnpm with-env next dev --port 2525 | pino-pretty -C", | ||
"dev-trace-deprecation": "NODE_OPTIONS=\"--trace-deprecation\" next dev --port 2525 | pino-pretty -C", | ||
"lint": "next lint", | ||
"lint": "eslint .", | ||
"lint-fix": "next lint --fix", | ||
"lint-debug": "eslint --debug .", | ||
"start": "next start", | ||
"type-check": "tsc --noEmit", | ||
"test": "pnpm with-env jest --colors --config jest.config.js", | ||
"test:seq": "pnpm with-env jest --colors --config jest.config.js --verbose --runInBand --no-cache", | ||
"test": "pnpm with-env jest --colors --config jest.config.mjs", | ||
"test:seq": "pnpm with-env jest --colors --config jest.config.mjs --verbose --runInBand --no-cache", | ||
"test-e2e": "pnpm with-env playwright test", | ||
"test-e2e-ui": "pnpm with-env playwright test --ui", | ||
"test-e2e-ui-serve": "pnpm build && pnpm start --port 4848 --turbo", | ||
"test-e2e-ui-built": "PORT=4848 pnpm with-env playwright test --ui", | ||
"test-coverage": "COLLECT_TEST_COVERAGE=true pnpm with-env jest --colors --config jest.config.js --coverage", | ||
"test-coverage": "COLLECT_TEST_COVERAGE=true pnpm with-env jest --colors --config jest.config.mjs --coverage", | ||
"with-env": "dotenv -e ../../.env --", | ||
"aila": "tsx scripts/aila-cli.ts", | ||
"storybook": "dotenv -e ../../.env -- storybook dev -p 6006 --no-open", | ||
|
@@ -46,11 +47,12 @@ | |
"@oakai/exports": "*", | ||
"@oakai/logger": "*", | ||
"@oakai/prettier-config": "*", | ||
"@oakai/eslint-config": "*", | ||
"@oaknational/oak-components": "^1.50.0", | ||
"@oaknational/oak-consent-client": "^2.1.0", | ||
"@portabletext/react": "^3.1.0", | ||
"@prisma/client": "5.16.1", | ||
"@prisma/extension-accelerate": "^1.0.0", | ||
"@prisma/client": "^5.16.1", | ||
"@prisma/extension-accelerate": "^1.2.1", | ||
"@radix-ui/react-accordion": "^1.1.2", | ||
"@radix-ui/react-icons": "^1.3.0", | ||
"@radix-ui/react-tooltip": "^1.0.7", | ||
|
@@ -141,7 +143,7 @@ | |
"@storybook/test": "^8.4.1", | ||
"@tailwindcss/typography": "^0.5.10", | ||
"@types/file-saver": "^2.0.6", | ||
"@types/jest": "^29.5.12", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^18.17.0", | ||
"@types/react": "^18.2.37", | ||
"@types/react-dom": "^18.2.15", | ||
|
@@ -150,17 +152,14 @@ | |
"avo": "^3.2.11", | ||
"concurrently": "^8.2.2", | ||
"dotenv-cli": "^6.0.0", | ||
"eslint": "^8.56.0", | ||
"eslint-config-next": "15.0.1", | ||
"eslint-plugin-storybook": "^0.8.0", | ||
"graphql": "^16.9.0", | ||
"jest": "^29.7.0", | ||
"msw": "^2.6.5", | ||
"msw-storybook-addon": "^2.0.4", | ||
"postcss": "^8.4.32", | ||
"tailwindcss": "^3.3.7", | ||
"ts-jest": "^29.1.4", | ||
"typescript": "5.3.3", | ||
"ts-jest": "^29.2.5", | ||
"typescript": "5.7.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumps Typescript to latest |
||
"web-streams-polyfill": "^4.0.0" | ||
}, | ||
"engines": { | ||
|
@@ -171,5 +170,12 @@ | |
"workerDirectory": [ | ||
".storybook/public" | ||
] | ||
}, | ||
"eslintConfig": { | ||
"extends": "@oakai/eslint-config", | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": {} | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import { createOpenAIClient } from "@oakai/core/src/llm/openai"; | |
import { aiLogger } from "@oakai/logger"; | ||
import fs from "fs/promises"; | ||
import type OpenAI from "openai"; | ||
import type { ChatCompletionCreateParamsNonStreaming } from "openai/resources"; | ||
import type { ChatCompletionCreateParamsNonStreaming } from "openai/resources/index.mjs"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why we have to do this now. This has changed a few times |
||
|
||
const log = aiLogger("fixtures"); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Inspired by Chatbot-UI and modified to fit the needs of this project | ||
// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Chat/ChatMessage.tsx | ||
import type { ReactNode } from "react"; | ||
import type { ReactNode, JSX } from "react"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Global JSX is now deprecated |
||
import { useState } from "react"; | ||
|
||
import type { MessagePart } from "@oakai/aila/src/protocol/jsonPatchProtocol"; | ||
|
@@ -200,7 +200,7 @@ function MessageWrapper({ | |
|
||
function MessageTextWrapper({ children }: Readonly<{ children: ReactNode }>) { | ||
return ( | ||
<div className=" flex w-full flex-col items-start justify-between"> | ||
<div className="flex w-full flex-col items-start justify-between"> | ||
{children} | ||
</div> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,15 @@ import { | |
|
||
const LOCAL_STORAGE_KEY = "sidebar"; | ||
|
||
export interface SidebarContext { | ||
export interface SidebarContextValue { | ||
isSidebarOpen: boolean; | ||
toggleSidebar: () => void; | ||
isLoading: boolean; | ||
} | ||
|
||
const SidebarContext = createContext<SidebarContext | undefined>(undefined); | ||
const SidebarContext = createContext<SidebarContextValue | undefined>( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The eslint config no longer likes types named the same as code definitions |
||
undefined, | ||
); | ||
|
||
export function useSidebar() { | ||
const context = useContext(SidebarContext); | ||
|
@@ -51,7 +53,7 @@ export function SidebarProvider({ children }: SidebarProviderProps) { | |
}); | ||
}, [setIsSidebarOpen]); | ||
|
||
const contextValue = useMemo(() => { | ||
const contextValue: SidebarContextValue = useMemo(() => { | ||
return { isSidebarOpen, toggleSidebar, isLoading }; | ||
}, [isSidebarOpen, isLoading, toggleSidebar]); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ export async function waitForStreamingStatusChange( | |
await page.waitForFunction( | ||
([currentStatus, expectedStatus]) => { | ||
const statusElement = document.querySelector( | ||
// eslint-disable-next-line @typescript-eslint/quotes, quotes | ||
// eslint-disable-next-line quotes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
'[data-testid="chat-aila-streaming-status"]', | ||
); | ||
return ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!