Skip to content

Commit 441afdd

Browse files
Refactor: Simplify config and types, remove unused tsconfig
Co-authored-by: ryanclementshax <ryanclementshax@gmail.com>
1 parent ac4ead6 commit 441afdd

6 files changed

Lines changed: 6 additions & 47 deletions

File tree

lib/constants.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ export const IS_PREVIEW = process.env.VERCEL_ENV === 'preview'
55

66
const protocol = IS_DEV ? 'http://' : 'https://'
77

8-
const configuredHost = process.env.NEXT_PUBLIC_URL && process.env.NEXT_PUBLIC_URL.trim().length > 0
9-
? process.env.NEXT_PUBLIC_URL
10-
: 'localhost:3000'
11-
12-
export const SITE_URL: string = protocol + configuredHost
8+
export const SITE_URL: string =
9+
protocol + (process.env.NEXT_PUBLIC_URL ?? 'localhost:3000')
1310

1411
export const RSS_FEED_URL = `${SITE_URL}/rss/feed.xml`
1512
export const JSON_FEED_URL = `${SITE_URL}/rss/feed.json`

next.config.mjs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import withBundleAnalyzer from '@next/bundle-analyzer'
66
const config = {
77
eslint: {
88
// https://nextjs.org/docs/basic-features/eslint#linting-custom-directories-and-files
9-
// Limit linting to app source to avoid Storybook/tests type noise in Next build
10-
dirs: ['app', 'components', 'lib', 'types']
11-
},
12-
typescript: {
13-
tsconfigPath: 'tsconfig.next.json',
14-
ignoreBuildErrors: true
9+
dirs: ['.']
1510
},
1611
images: {
1712
remotePatterns: [

stories/storyUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { BaseAnnotations, StoryAnnotations } from '@storybook/types'
33
import { Theme } from 'components/theme'
44
import merge from 'just-merge'
55
import clone from 'just-clone'
6-
import type { PlayFunction } from '@storybook/types'
76

87
export interface StoryModifier<T> {
98
(story: StoryFn<T>): StoryFn<T>
@@ -78,7 +77,7 @@ export const withArgs: <T>(args?: Args<T>) => StoryModifier<T> =
7877

7978
export const withPlay: <T>(play?: StorybookPlay<T>) => StoryModifier<T> =
8079
play => story => {
81-
story.play = play as unknown as PlayFunction
80+
story.play = play
8281
return story
8382
}
8483

tests/testSetup.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import { toHaveNoViolations } from 'jest-axe'
33
import { setProjectAnnotations } from '@storybook/react'
44
import * as globalStorybookConfig from '../.storybook/preview'
55
import { LinkProps } from 'next/link'
6-
import type { ProjectAnnotations } from '@storybook/types'
76

8-
setProjectAnnotations(globalStorybookConfig as unknown as ProjectAnnotations)
7+
setProjectAnnotations(globalStorybookConfig)
98

109
expect.extend(toHaveNoViolations)
1110

tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@
2525
}
2626
]
2727
},
28-
"exclude": [
29-
"node_modules",
30-
".next",
31-
"out",
32-
"storybook-static",
33-
"**/dist",
34-
"stories/**"
35-
],
28+
"exclude": ["node_modules", ".next", "out", "storybook-static", "**/dist"],
3629
"include": [
3730
"next-env.d.ts",
3831
"**/*.ts",

tsconfig.next.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)