Unverified Commit c1a09471 authored by Mateusz Burzyński's avatar Mateusz Burzyński Committed by GitHub

Add missing `typescript` property to `NextConfig` (#28459)

This is similar to https://github.com/vercel/next.js/pull/27126 , https://github.com/vercel/next.js/pull/27446 and https://github.com/vercel/next.js/pull/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
parent 005b13f1
...@@ -176,7 +176,7 @@ export default async function build( ...@@ -176,7 +176,7 @@ export default async function build(
telemetry.record(events) telemetry.record(events)
) )
const ignoreTypeScriptErrors = Boolean(config.typescript?.ignoreBuildErrors) const ignoreTypeScriptErrors = Boolean(config.typescript.ignoreBuildErrors)
const typeCheckStart = process.hrtime() const typeCheckStart = process.hrtime()
const typeCheckingSpinner = createSpinner({ const typeCheckingSpinner = createSpinner({
prefixText: `${Log.prefixes.info} ${ prefixText: `${Log.prefixes.info} ${
...@@ -216,7 +216,7 @@ export default async function build( ...@@ -216,7 +216,7 @@ export default async function build(
typeCheckingSpinner.stopAndPersist() typeCheckingSpinner.stopAndPersist()
} }
const ignoreESLint = Boolean(config.eslint?.ignoreDuringBuilds) const ignoreESLint = Boolean(config.eslint.ignoreDuringBuilds)
const eslintCacheDir = path.join(cacheDir, 'eslint/') const eslintCacheDir = path.join(cacheDir, 'eslint/')
if (!ignoreESLint && runLint) { if (!ignoreESLint && runLint) {
await nextBuildSpan await nextBuildSpan
......
...@@ -29,10 +29,16 @@ export interface ESLintConfig { ...@@ -29,10 +29,16 @@ export interface ESLintConfig {
ignoreDuringBuilds?: boolean ignoreDuringBuilds?: boolean
} }
export interface TypeScriptConfig {
/** Do not run TypeScript during production builds (`next build`). */
ignoreBuildErrors?: boolean
}
export type NextConfig = { [key: string]: any } & { export type NextConfig = { [key: string]: any } & {
i18n?: I18NConfig | null i18n?: I18NConfig | null
eslint?: ESLintConfig eslint?: ESLintConfig
typescript?: TypeScriptConfig
headers?: () => Promise<Header[]> headers?: () => Promise<Header[]>
rewrites?: () => Promise< rewrites?: () => Promise<
...@@ -139,6 +145,12 @@ export const defaultConfig: NextConfig = { ...@@ -139,6 +145,12 @@ export const defaultConfig: NextConfig = {
env: {}, env: {},
webpack: null, webpack: null,
webpackDevMiddleware: null, webpackDevMiddleware: null,
eslint: {
ignoreDuringBuilds: false,
},
typescript: {
ignoreBuildErrors: false,
},
distDir: '.next', distDir: '.next',
cleanDistDir: true, cleanDistDir: true,
assetPrefix: '', assetPrefix: '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment