Skip to content

Commit

Permalink
Enable noUnusedLocals for type checking test files
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed May 30, 2024
1 parent 50ca7f8 commit 9c8c659
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 30 deletions.
1 change: 0 additions & 1 deletion test/unit/esm-interpolate/esm-interpolate.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { renderToString } from 'react-dom/server'
import * as nextRouter from 'next/router'

Expand Down
1 change: 0 additions & 1 deletion test/unit/esm-interpolate/fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { useRouter } from 'next/router'

export const Foo = () => {
Expand Down
1 change: 0 additions & 1 deletion test/unit/link-warnings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { act, render } from '@testing-library/react'
import Link from 'next/link'
import React from 'react'

describe('<Link/>', () => {
let spy
Expand Down
1 change: 0 additions & 1 deletion test/unit/next-dynamic.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @jest-environment jsdom
*/
import React from 'react'
import { act, render } from '@testing-library/react'
import dynamic from 'next/dynamic'

Expand Down
23 changes: 0 additions & 23 deletions tsconfig.base.json

This file was deleted.

26 changes: 23 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
{
"extends": "./tsconfig.base.json",
"include": ["test/**/*.test.ts", "test/**/*.test.tsx"],
"exclude": ["node_modules"]
"compilerOptions": {
"allowJs": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noUnusedLocals": true,
"paths": {
"amp-test-utils": ["./test/lib/amp-test-utils"],
"development-sandbox": ["./test/lib/development-sandbox"],
"e2e-utils": ["./test/lib/e2e-utils"],
"next-test-utils": ["./test/lib/next-test-utils"],
"next-webdriver": ["./test/lib/next-webdriver"],
"test-data-service/*": ["./test/lib/test-data-service/*"],
"test-log": ["./test/lib/test-log"]
},
"resolveJsonModule": true,
"strict": false,
"target": "ESNext",
"types": ["react", "jest", "node", "trusted-types", "jest-extended"]
},
"include": ["test/**/*.test.ts", "test/**/*.test.tsx"]
}

0 comments on commit 9c8c659

Please sign in to comment.