Skip to content

Commit ad8db9b

Browse files
committed
fix!: change failOnWarn default from 'ci-only' to false
1 parent 6c30541 commit ad8db9b

File tree

9 files changed

+23
-31
lines changed

9 files changed

+23
-31
lines changed

docs/advanced/ci.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The following options accept CI-aware values:
2828
- [`exports`](/options/package-exports) — Auto-generate `package.json` exports
2929
- `unused` — Unused dependency check
3030
- `devtools` — DevTools integration
31-
- `failOnWarn` — Fail on warnings (defaults to `'ci-only'`)
31+
- `failOnWarn` — Fail on warnings (defaults to `false`)
3232

3333
### Basic Usage
3434

@@ -42,7 +42,7 @@ export default defineConfig({
4242
dts: 'local-only',
4343
// Only run publint in CI
4444
publint: 'ci-only',
45-
// Fail on warnings in CI only (this is the default)
45+
// Fail on warnings in CI only
4646
failOnWarn: 'ci-only',
4747
})
4848
```
@@ -90,7 +90,7 @@ export default defineConfig({
9090
entry: 'src/index.ts',
9191
format: ['esm', 'cjs'],
9292
dts: true,
93-
// Fail on warnings in CI
93+
// Fail on warnings in CI (opt-in)
9494
failOnWarn: 'ci-only',
9595
// Run package validators in CI
9696
publint: 'ci-only',

docs/options/log-level.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,16 @@ Choose the log level that best fits your workflow to control the amount of infor
2929

3030
## Fail on Warnings
3131

32-
The `failOnWarn` option controls whether warnings cause the build to exit with a non-zero code. By default, this is set to `'ci-only'`, which means **warnings will cause the build to fail in CI environments** but not locally.
33-
34-
This default behavior ensures that CI pipelines catch potential issues while keeping local development uninterrupted.
32+
The `failOnWarn` option controls whether warnings cause the build to exit with a non-zero code.
3533

3634
```ts [tsdown.config.ts]
3735
import { defineConfig } from 'tsdown'
3836

3937
export default defineConfig({
40-
// Default: fail on warnings only in CI
41-
failOnWarn: 'ci-only',
4238
// Always fail on warnings
43-
// failOnWarn: true,
44-
// Never fail on warnings
45-
// failOnWarn: false,
39+
failOnWarn: true,
40+
// Fail on warnings only in CI
41+
failOnWarn: 'ci-only',
4642
})
4743
```
4844

docs/zh-CN/advanced/ci.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tsdown 使用 [`is-in-ci`](https://www.npmjs.com/package/is-in-ci) 包来检测
2828
- [`exports`](/zh-CN/options/package-exports) — 自动生成 `package.json` exports 字段
2929
- `unused` — 未使用依赖检查
3030
- `devtools` — DevTools 集成
31-
- `failOnWarn` — 遇警告时失败(默认值为 `'ci-only'`
31+
- `failOnWarn` — 遇警告时失败(默认值为 `false`
3232

3333
### 基本用法
3434

@@ -42,7 +42,7 @@ export default defineConfig({
4242
dts: 'local-only',
4343
// 仅在 CI 中运行 publint
4444
publint: 'ci-only',
45-
// 仅在 CI 中遇警告时失败(这是默认行为)
45+
// 仅在 CI 中遇警告时失败
4646
failOnWarn: 'ci-only',
4747
})
4848
```
@@ -90,7 +90,7 @@ export default defineConfig({
9090
entry: 'src/index.ts',
9191
format: ['esm', 'cjs'],
9292
dts: true,
93-
// 在 CI 中遇警告时失败
93+
// 在 CI 中遇警告时失败(需手动启用)
9494
failOnWarn: 'ci-only',
9595
// 在 CI 中运行包校验工具
9696
publint: 'ci-only',

docs/zh-CN/options/log-level.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,16 @@ tsdown --log-level error
2929

3030
## 警告时失败
3131

32-
`failOnWarn` 选项控制警告是否会导致构建以非零退出码退出。默认值为 `'ci-only'`,这意味着**在 CI 环境中,警告会导致构建失败**,但在本地开发时不会。
33-
34-
这种默认行为确保 CI 流水线能够发现潜在问题,同时不会影响本地开发体验。
32+
`failOnWarn` 选项控制警告是否会导致构建以非零退出码退出。
3533

3634
```ts [tsdown.config.ts]
3735
import { defineConfig } from 'tsdown'
3836

3937
export default defineConfig({
40-
// 默认:仅在 CI 中遇警告时失败
41-
failOnWarn: 'ci-only',
4238
// 始终在遇到警告时失败
43-
// failOnWarn: true,
44-
// 从不在遇到警告时失败
45-
// failOnWarn: false,
39+
failOnWarn: true,
40+
// 仅在 CI 中遇警告时失败
41+
failOnWarn: 'ci-only',
4642
})
4743
```
4844

skills/tsdown/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default defineConfig({
7777
| Source maps | `sourcemap: true`, `'inline'`, `'hidden'` | [option-sourcemap](references/option-sourcemap.md) |
7878
| Watch mode | `watch: true`, watch options | [option-watch-mode](references/option-watch-mode.md) |
7979
| Cleaning | `clean: true`, clean patterns | [option-cleaning](references/option-cleaning.md) |
80-
| Log level | `logLevel: 'silent'`, `failOnWarn: 'ci-only'` | [option-log-level](references/option-log-level.md) |
80+
| Log level | `logLevel: 'silent'`, `failOnWarn: false` | [option-log-level](references/option-log-level.md) |
8181

8282
## Dependency Handling
8383

@@ -182,7 +182,7 @@ export default defineConfig({
182182
entry: ['src/index.ts'],
183183
format: ['esm', 'cjs'],
184184
dts: true,
185-
failOnWarn: 'ci-only',
185+
failOnWarn: 'ci-only', // opt-in: fail on warnings in CI
186186
publint: 'ci-only',
187187
attw: 'ci-only',
188188
})

skills/tsdown/references/advanced-ci.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ These options accept CI-aware values:
2828
- `exports` - Auto-generate `package.json` exports
2929
- `unused` - Unused dependency check
3030
- `devtools` - DevTools integration
31-
- `failOnWarn` - Fail on warnings (defaults to `'ci-only'`)
31+
- `failOnWarn` - Fail on warnings (defaults to `false`)
3232

3333
## Usage
3434

@@ -38,7 +38,7 @@ These options accept CI-aware values:
3838
export default defineConfig({
3939
dts: 'local-only', // Skip DTS in CI for faster builds
4040
publint: 'ci-only', // Only run publint in CI
41-
failOnWarn: 'ci-only', // Fail on warnings in CI only (default)
41+
failOnWarn: 'ci-only', // Fail on warnings in CI only (opt-in)
4242
})
4343
```
4444

skills/tsdown/references/option-log-level.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ export default defineConfig({
7272

7373
## Fail on Warnings
7474

75-
The `failOnWarn` option controls whether warnings cause the build to exit with a non-zero code. Defaults to `'ci-only'` — warnings fail the build in CI but not locally.
75+
The `failOnWarn` option controls whether warnings cause the build to exit with a non-zero code. Defaults to `false` — warnings never fail the build.
7676

7777
```ts
7878
export default defineConfig({
79-
failOnWarn: 'ci-only', // Default: fail on warnings only in CI
79+
failOnWarn: false, // Default: never fail on warnings
8080
// failOnWarn: true, // Always fail on warnings
81-
// failOnWarn: false, // Never fail on warnings
81+
// failOnWarn: 'ci-only', // Fail on warnings only in CI
8282
})
8383
```
8484

src/config/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function resolveUserConfig(
5252
plugins = [],
5353
clean = true,
5454
logLevel = 'info',
55-
failOnWarn = 'ci-only',
55+
failOnWarn = false,
5656
customLogger,
5757
treeshake = true,
5858
platform = 'node',

src/config/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ export interface UserConfig {
449449
logLevel?: LogLevel
450450
/**
451451
* If true, fails the build on warnings.
452-
* @default 'ci-only'
452+
* @default false
453453
*/
454454
failOnWarn?: boolean | CIOption
455455
/**

0 commit comments

Comments
 (0)