From 9927904ece1a47cc72690f71d642074c4ebc08a4 Mon Sep 17 00:00:00 2001 From: JaeYoung <87258182+SaeWooKKang@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:11:43 +0900 Subject: [PATCH] fix(examples): Remove conflicting React type definitions (#779) --- examples/react/dynamic/src/main.tsx | 13 ++++--- examples/react/dynamic/tsconfig.dev.json | 12 ------ examples/react/dynamic/tsconfig.json | 25 ++++++++++++ examples/react/fixed/src/main.tsx | 1 + examples/react/fixed/tsconfig.dev.json | 12 ------ examples/react/fixed/tsconfig.json | 25 ++++++++++++ examples/react/infinite-scroll/package.json | 6 ++- examples/react/infinite-scroll/src/main.tsx | 6 +-- .../react/infinite-scroll/tsconfig.dev.json | 12 ------ examples/react/infinite-scroll/tsconfig.json | 25 ++++++++++++ examples/react/padding/package.json | 6 ++- examples/react/padding/src/main.tsx | 18 ++++++--- examples/react/padding/tsconfig.dev.json | 12 ------ examples/react/padding/tsconfig.json | 25 ++++++++++++ examples/react/scroll-padding/package.json | 2 + examples/react/scroll-padding/src/main.tsx | 2 +- .../react/scroll-padding/tsconfig.dev.json | 12 ------ examples/react/scroll-padding/tsconfig.json | 25 ++++++++++++ examples/react/smooth-scroll/package.json | 6 ++- examples/react/smooth-scroll/src/main.tsx | 13 +++---- .../react/smooth-scroll/tsconfig.dev.json | 12 ------ examples/react/smooth-scroll/tsconfig.json | 25 ++++++++++++ examples/react/sticky/package.json | 3 ++ examples/react/sticky/src/main.tsx | 24 +++++++----- examples/react/sticky/tsconfig.dev.json | 12 ------ examples/react/sticky/tsconfig.json | 25 ++++++++++++ examples/react/table/src/main.tsx | 11 +++--- examples/react/table/tsconfig.dev.json | 12 ------ examples/react/table/tsconfig.json | 25 ++++++++++++ examples/react/variable/package.json | 6 ++- examples/react/variable/src/main.tsx | 30 +++++++++----- examples/react/variable/tsconfig.dev.json | 12 ------ examples/react/variable/tsconfig.json | 25 ++++++++++++ examples/react/window/tsconfig.dev.json | 12 ------ examples/react/window/tsconfig.json | 25 ++++++++++++ pnpm-lock.yaml | 39 +++++++++++++++++++ 36 files changed, 379 insertions(+), 177 deletions(-) delete mode 100644 examples/react/dynamic/tsconfig.dev.json create mode 100644 examples/react/dynamic/tsconfig.json delete mode 100644 examples/react/fixed/tsconfig.dev.json create mode 100644 examples/react/fixed/tsconfig.json delete mode 100644 examples/react/infinite-scroll/tsconfig.dev.json create mode 100644 examples/react/infinite-scroll/tsconfig.json delete mode 100644 examples/react/padding/tsconfig.dev.json create mode 100644 examples/react/padding/tsconfig.json delete mode 100644 examples/react/scroll-padding/tsconfig.dev.json create mode 100644 examples/react/scroll-padding/tsconfig.json delete mode 100644 examples/react/smooth-scroll/tsconfig.dev.json create mode 100644 examples/react/smooth-scroll/tsconfig.json delete mode 100644 examples/react/sticky/tsconfig.dev.json create mode 100644 examples/react/sticky/tsconfig.json delete mode 100644 examples/react/table/tsconfig.dev.json create mode 100644 examples/react/table/tsconfig.json delete mode 100644 examples/react/variable/tsconfig.dev.json create mode 100644 examples/react/variable/tsconfig.json delete mode 100644 examples/react/window/tsconfig.dev.json create mode 100644 examples/react/window/tsconfig.json diff --git a/examples/react/dynamic/src/main.tsx b/examples/react/dynamic/src/main.tsx index 5eb7eda7..d1821216 100644 --- a/examples/react/dynamic/src/main.tsx +++ b/examples/react/dynamic/src/main.tsx @@ -172,8 +172,8 @@ function GridVirtualizerDynamic({ columns, data, }: { - data: string[][] - columns: Column[] + data: Array> + columns: Array }) { const parentRef = React.useRef(null) @@ -277,9 +277,9 @@ const generateColumns = (count: number) => { }) } -const generateData = (columns: Column[], count = 300) => { +const generateData = (columns: Array, count = 300) => { return new Array(count).fill(0).map((_, rowIndex) => - columns.reduce((acc, _curr, colIndex) => { + columns.reduce>((acc, _curr, colIndex) => { // simulate dynamic size cells const val = faker.lorem.lines(((rowIndex + colIndex) % 10) + 1) @@ -344,8 +344,9 @@ function App() { ) } -const container = document.getElementById('root') -const root = createRoot(container!) +// eslint-disable-next-line +const container = document.getElementById('root')! +const root = createRoot(container) const { StrictMode } = React root.render( diff --git a/examples/react/dynamic/tsconfig.dev.json b/examples/react/dynamic/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/dynamic/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/dynamic/tsconfig.json b/examples/react/dynamic/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/dynamic/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/react/fixed/src/main.tsx b/examples/react/fixed/src/main.tsx index a67ed5bf..3b656532 100644 --- a/examples/react/fixed/src/main.tsx +++ b/examples/react/fixed/src/main.tsx @@ -212,6 +212,7 @@ function GridVirtualizerFixed() { ) } +// eslint-disable-next-line ReactDOM.createRoot(document.getElementById('root')!).render( diff --git a/examples/react/fixed/tsconfig.dev.json b/examples/react/fixed/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/fixed/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/fixed/tsconfig.json b/examples/react/fixed/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/fixed/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/react/infinite-scroll/package.json b/examples/react/infinite-scroll/package.json index 271a8d4d..171f3428 100644 --- a/examples/react/infinite-scroll/package.json +++ b/examples/react/infinite-scroll/package.json @@ -10,11 +10,13 @@ }, "dependencies": { "@tanstack/react-virtual": "^3.8.4", + "@tanstack/react-query": "^5.51.15", "react": "^18.3.1", - "react-dom": "^18.3.1", - "@tanstack/react-query": "^5.51.15" + "react-dom": "^18.3.1" }, "devDependencies": { + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.5" } diff --git a/examples/react/infinite-scroll/src/main.tsx b/examples/react/infinite-scroll/src/main.tsx index 13d47864..3567dc4b 100644 --- a/examples/react/infinite-scroll/src/main.tsx +++ b/examples/react/infinite-scroll/src/main.tsx @@ -15,7 +15,7 @@ const queryClient = new QueryClient() async function fetchServerPage( limit: number, offset: number = 0, -): Promise<{ rows: string[]; nextOffset: number }> { +): Promise<{ rows: Array; nextOffset: number }> { const rows = new Array(limit) .fill(0) .map((e, i) => `Async loaded row #${i + offset * limit}`) @@ -43,7 +43,7 @@ function App() { const allRows = data ? data.pages.flatMap((d) => d.rows) : [] - const parentRef = React.useRef() + const parentRef = React.useRef(null) const rowVirtualizer = useVirtualizer({ count: hasNextPage ? allRows.length + 1 : allRows.length, @@ -89,7 +89,7 @@ function App() { {status === 'pending' ? (

Loading...

) : status === 'error' ? ( - Error: {(error as Error).message} + Error: {error.message} ) : (
}) { + const parentRef = React.useRef(null) const rowVirtualizer = useVirtualizer({ count: rows.length, @@ -91,8 +91,8 @@ function RowVirtualizerDynamic({ rows }) { ) } -function ColumnVirtualizerDynamic({ columns }) { - const parentRef = React.useRef() +function ColumnVirtualizerDynamic({ columns }: { columns: Array }) { + const parentRef = React.useRef(null) const columnVirtualizer = useVirtualizer({ horizontal: true, @@ -146,8 +146,14 @@ function ColumnVirtualizerDynamic({ columns }) { ) } -function GridVirtualizerDynamic({ rows, columns }) { - const parentRef = React.useRef() +function GridVirtualizerDynamic({ + rows, + columns, +}: { + rows: Array + columns: Array +}) { + const parentRef = React.useRef(null) const rowVirtualizer = useVirtualizer({ count: rows.length, diff --git a/examples/react/padding/tsconfig.dev.json b/examples/react/padding/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/padding/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/padding/tsconfig.json b/examples/react/padding/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/padding/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/react/scroll-padding/package.json b/examples/react/scroll-padding/package.json index aadc387e..0f42d6a9 100644 --- a/examples/react/scroll-padding/package.json +++ b/examples/react/scroll-padding/package.json @@ -15,6 +15,8 @@ "react-dom": "^18.3.1" }, "devDependencies": { + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.5" } diff --git a/examples/react/scroll-padding/src/main.tsx b/examples/react/scroll-padding/src/main.tsx index f7429de8..47488a58 100644 --- a/examples/react/scroll-padding/src/main.tsx +++ b/examples/react/scroll-padding/src/main.tsx @@ -7,7 +7,7 @@ import { useMeasure } from '@react-hookz/web' import { useVirtualizer } from '@tanstack/react-virtual' function App() { - const parentRef = React.useRef() + const parentRef = React.useRef(null) const [theadSize, theadRef] = useMeasure() const rowVirtualizer = useVirtualizer({ diff --git a/examples/react/scroll-padding/tsconfig.dev.json b/examples/react/scroll-padding/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/scroll-padding/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/scroll-padding/tsconfig.json b/examples/react/scroll-padding/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/scroll-padding/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/react/smooth-scroll/package.json b/examples/react/smooth-scroll/package.json index 68cde16c..e2373679 100644 --- a/examples/react/smooth-scroll/package.json +++ b/examples/react/smooth-scroll/package.json @@ -9,11 +9,13 @@ "start": "vite" }, "dependencies": { + "@tanstack/react-virtual": "^3.8.4", "react": "^18.3.1", - "react-dom": "^18.3.1", - "@tanstack/react-virtual": "^3.8.4" + "react-dom": "^18.3.1" }, "devDependencies": { + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.5" } diff --git a/examples/react/smooth-scroll/src/main.tsx b/examples/react/smooth-scroll/src/main.tsx index d040cf92..eaa33962 100644 --- a/examples/react/smooth-scroll/src/main.tsx +++ b/examples/react/smooth-scroll/src/main.tsx @@ -3,24 +3,21 @@ import ReactDOM from 'react-dom' import './index.css' -import { - elementScroll, - useVirtualizer, - VirtualizerOptions, -} from '@tanstack/react-virtual' +import { elementScroll, useVirtualizer } from '@tanstack/react-virtual' +import type { VirtualizerOptions } from '@tanstack/react-virtual' -function easeInOutQuint(t) { +function easeInOutQuint(t: number) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t } function App() { - const parentRef = React.useRef() + const parentRef = React.useRef(null) const scrollingRef = React.useRef() const scrollToFn: VirtualizerOptions['scrollToFn'] = React.useCallback((offset, canSmooth, instance) => { const duration = 1000 - const start = parentRef.current.scrollTop + const start = parentRef.current?.scrollTop || 0 const startTime = (scrollingRef.current = Date.now()) const run = () => { diff --git a/examples/react/smooth-scroll/tsconfig.dev.json b/examples/react/smooth-scroll/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/smooth-scroll/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/smooth-scroll/tsconfig.json b/examples/react/smooth-scroll/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/smooth-scroll/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/react/sticky/package.json b/examples/react/sticky/package.json index ff0c77c7..09edd2f7 100644 --- a/examples/react/sticky/package.json +++ b/examples/react/sticky/package.json @@ -16,6 +16,9 @@ "react-dom": "^18.3.1" }, "devDependencies": { + "@types/lodash": "^4.17.7", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.5" } diff --git a/examples/react/sticky/src/main.tsx b/examples/react/sticky/src/main.tsx index 0870a230..00dbd8e7 100644 --- a/examples/react/sticky/src/main.tsx +++ b/examples/react/sticky/src/main.tsx @@ -3,7 +3,8 @@ import * as React from 'react' import ReactDOM from 'react-dom' import { faker } from '@faker-js/faker' import { findIndex, groupBy } from 'lodash' -import { useVirtualizer, defaultRangeExtractor } from '@tanstack/react-virtual' +import { defaultRangeExtractor, useVirtualizer } from '@tanstack/react-virtual' +import type { Range } from '@tanstack/react-virtual' const groupedNames = groupBy( Array.from({ length: 1000 }) @@ -12,10 +13,13 @@ const groupedNames = groupBy( (name) => name[0], ) const groups = Object.keys(groupedNames) -const rows = groups.reduce((acc, k) => [...acc, k, ...groupedNames[k]], []) +const rows = groups.reduce>( + (acc, k) => [...acc, k, ...groupedNames[k]], + [], +) const App = () => { - const parentRef = React.useRef() + const parentRef = React.useRef(null) const activeStickyIndexRef = React.useRef(0) @@ -24,19 +28,21 @@ const App = () => { [], ) - const isSticky = (index) => stickyIndexes.includes(index) + const isSticky = (index: number) => stickyIndexes.includes(index) - const isActiveSticky = (index) => activeStickyIndexRef.current === index + const isActiveSticky = (index: number) => + activeStickyIndexRef.current === index const rowVirtualizer = useVirtualizer({ count: rows.length, estimateSize: () => 50, getScrollElement: () => parentRef.current, rangeExtractor: React.useCallback( - (range) => { - activeStickyIndexRef.current = [...stickyIndexes] - .reverse() - .find((index) => range.startIndex >= index) + (range: Range) => { + activeStickyIndexRef.current = + [...stickyIndexes] + .reverse() + .find((index) => range.startIndex >= index) ?? 0 const next = new Set([ activeStickyIndexRef.current, diff --git a/examples/react/sticky/tsconfig.dev.json b/examples/react/sticky/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/sticky/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/sticky/tsconfig.json b/examples/react/sticky/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/sticky/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/react/table/src/main.tsx b/examples/react/table/src/main.tsx index 8ed0d807..4158ce6c 100644 --- a/examples/react/table/src/main.tsx +++ b/examples/react/table/src/main.tsx @@ -3,21 +3,20 @@ import { createRoot } from 'react-dom/client' import { useVirtualizer } from '@tanstack/react-virtual' import { - ColumnDef, flexRender, getCoreRowModel, getSortedRowModel, - Row, - SortingState, useReactTable, } from '@tanstack/react-table' -import { makeData, Person } from './makeData' +import { makeData } from './makeData' +import type { ColumnDef, Row, SortingState } from '@tanstack/react-table' +import type { Person } from './makeData' import './index.css' function ReactTableVirtualized() { const [sorting, setSorting] = React.useState([]) - const columns = React.useMemo[]>( + const columns = React.useMemo>>( () => [ { accessorKey: 'id', @@ -128,7 +127,7 @@ function ReactTableVirtualized() { {virtualizer.getVirtualItems().map((virtualRow, index) => { - const row = rows[virtualRow.index] as Row + const row = rows[virtualRow.index] return ( }) { + const parentRef = React.useRef(null) const rowVirtualizer = useVirtualizer({ count: rows.length, @@ -104,8 +104,8 @@ function RowVirtualizerVariable({ rows }) { ) } -function ColumnVirtualizerVariable({ columns }) { - const parentRef = React.useRef() +function ColumnVirtualizerVariable({ columns }: { columns: Array }) { + const parentRef = React.useRef(null) const columnVirtualizer = useVirtualizer({ horizontal: true, @@ -157,8 +157,14 @@ function ColumnVirtualizerVariable({ columns }) { ) } -function GridVirtualizerVariable({ rows, columns }) { - const parentRef = React.useRef() +function GridVirtualizerVariable({ + rows, + columns, +}: { + rows: Array + columns: Array +}) { + const parentRef = React.useRef(null) const rowVirtualizer = useVirtualizer({ count: rows.length, @@ -227,8 +233,8 @@ function GridVirtualizerVariable({ rows, columns }) { ) } -function MasonryVerticalVirtualizerVariable({ rows }) { - const parentRef = React.useRef() +function MasonryVerticalVirtualizerVariable({ rows }: { rows: Array }) { + const parentRef = React.useRef(null) const rowVirtualizer = useVirtualizer({ count: rows.length, @@ -278,8 +284,12 @@ function MasonryVerticalVirtualizerVariable({ rows }) { ) } -function MasonryHorizontalVirtualizerVariable({ rows }) { - const parentRef = React.useRef() +function MasonryHorizontalVirtualizerVariable({ + rows, +}: { + rows: Array +}) { + const parentRef = React.useRef(null) const columnVirtualizer = useVirtualizer({ horizontal: true, diff --git a/examples/react/variable/tsconfig.dev.json b/examples/react/variable/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/variable/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/variable/tsconfig.json b/examples/react/variable/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/variable/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/react/window/tsconfig.dev.json b/examples/react/window/tsconfig.dev.json deleted file mode 100644 index c09bc865..00000000 --- a/examples/react/window/tsconfig.dev.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "composite": true, - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./build/types" - }, - "files": ["src/main.tsx"], - "include": [ - "src" - // "__tests__/**/*.test.*" - ] -} diff --git a/examples/react/window/tsconfig.json b/examples/react/window/tsconfig.json new file mode 100644 index 00000000..87318025 --- /dev/null +++ b/examples/react/window/tsconfig.json @@ -0,0 +1,25 @@ +{ + "composite": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e938956d..de6a664d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -184,6 +184,12 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) devDependencies: + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.3.5(@types/node@18.19.42)) @@ -203,6 +209,12 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) devDependencies: + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.3.5(@types/node@18.19.42)) @@ -225,6 +237,12 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) devDependencies: + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.3.5(@types/node@18.19.42)) @@ -244,6 +262,12 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) devDependencies: + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.3.5(@types/node@18.19.42)) @@ -269,6 +293,15 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) devDependencies: + '@types/lodash': + specifier: ^4.17.7 + version: 4.17.7 + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.3.5(@types/node@18.19.42)) @@ -319,6 +352,12 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) devDependencies: + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.3.5(@types/node@18.19.42))