Skip to content

Commit

Permalink
Add missing typescript property to NextConfig (#28459)
Browse files Browse the repository at this point in the history
This is similar to #27126 , #27446 and #27974

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
  • Loading branch information
Andarist committed Aug 24, 2021
1 parent 005b13f commit c1a0947
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next/build/index.ts
Expand Up @@ -176,7 +176,7 @@ export default async function build(
telemetry.record(events)
)

const ignoreTypeScriptErrors = Boolean(config.typescript?.ignoreBuildErrors)
const ignoreTypeScriptErrors = Boolean(config.typescript.ignoreBuildErrors)
const typeCheckStart = process.hrtime()
const typeCheckingSpinner = createSpinner({
prefixText: `${Log.prefixes.info} ${
Expand Down Expand Up @@ -216,7 +216,7 @@ export default async function build(
typeCheckingSpinner.stopAndPersist()
}

const ignoreESLint = Boolean(config.eslint?.ignoreDuringBuilds)
const ignoreESLint = Boolean(config.eslint.ignoreDuringBuilds)
const eslintCacheDir = path.join(cacheDir, 'eslint/')
if (!ignoreESLint && runLint) {
await nextBuildSpan
Expand Down
12 changes: 12 additions & 0 deletions packages/next/server/config-shared.ts
Expand Up @@ -29,10 +29,16 @@ export interface ESLintConfig {
ignoreDuringBuilds?: boolean
}

export interface TypeScriptConfig {
/** Do not run TypeScript during production builds (`next build`). */
ignoreBuildErrors?: boolean
}

export type NextConfig = { [key: string]: any } & {
i18n?: I18NConfig | null

eslint?: ESLintConfig
typescript?: TypeScriptConfig

headers?: () => Promise<Header[]>
rewrites?: () => Promise<
Expand Down Expand Up @@ -139,6 +145,12 @@ export const defaultConfig: NextConfig = {
env: {},
webpack: null,
webpackDevMiddleware: null,
eslint: {
ignoreDuringBuilds: false,
},
typescript: {
ignoreBuildErrors: false,
},
distDir: '.next',
cleanDistDir: true,
assetPrefix: '',
Expand Down

0 comments on commit c1a0947

Please sign in to comment.