Skip to content

Commit

Permalink
chore: enable verbatimModuleSyntax in tsconfig (#2649)
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Jul 20, 2024
1 parent e137774 commit 66f3a02
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test-old-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Patch for v4/v3 TS
if: ${{ startsWith(matrix.typescript, '4.') || startsWith(matrix.typescript, '3.') }}
run: |
sed -i~ 's/"verbatimModuleSyntax": true,//' tsconfig.json
- name: Patch for Old TS
run: |
sed -i~ 's/\/\/ @ts-expect-error.*\[LATEST-TS-ONLY\]//' tests/*.tsx
Expand Down
2 changes: 1 addition & 1 deletion tests/basic.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
Component as ClassComponent,
ReactNode,
StrictMode,
useEffect,
useLayoutEffect,
useState,
} from 'react'
import type { ReactNode } from 'react'
import { act, fireEvent, render } from '@testing-library/react'
import ReactDOM from 'react-dom'
import { afterEach, expect, it, vi } from 'vitest'
Expand Down
2 changes: 1 addition & 1 deletion tests/context.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
Component as ClassComponent,
ReactNode,
StrictMode,
useCallback,
useEffect,
useState,
} from 'react'
import type { ReactNode } from 'react'
import { render } from '@testing-library/react'
import { afterEach, it, vi } from 'vitest'
import { create } from 'zustand'
Expand Down
3 changes: 2 additions & 1 deletion tests/devtools.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { devtools, redux } from 'zustand/middleware'
import { StoreApi, createStore } from 'zustand/vanilla'
import { createStore } from 'zustand/vanilla'
import type { StoreApi } from 'zustand/vanilla'

type TupleOfEqualLengthH<
Arr extends unknown[],
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"allowImportingTsExtensions": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
Expand Down

0 comments on commit 66f3a02

Please sign in to comment.