Skip to content

feat: add env var to suppress program diagnostics#739

Merged
camc314 merged 11 commits intooxc-project:mainfrom
logaretm:awad/env-disable-tsconfig-error
Mar 3, 2026
Merged

feat: add env var to suppress program diagnostics#739
camc314 merged 11 commits intooxc-project:mainfrom
logaretm:awad/env-disable-tsconfig-error

Conversation

@logaretm
Copy link
Contributor

Adds OXLINT_TSGOLINT_SUPPRESS_PROGRAM_DIAGNOSTICS env variable check to suppress errors coming out of tsconfig-error diagnostics.

Usage:

OXLINT_TSGOLINT_SUPPRESS_PROGRAM_DIAGNOSTICS=true pnpm oxlint . --type-aware

closes #736

Copilot AI review requested due to automatic review settings February 24, 2026 17:00
@logaretm logaretm changed the title feat: Add env variable to suppress tsconfig checks feat: Add env variable to suppress tsconfig errors Feb 24, 2026
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work how you expect - we early return if there are any program diagnostics when creating the program. This means that the program isn't linted

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for suppressing tsconfig-error diagnostics via an environment variable OXLINT_TSGOLINT_SUPPRESS_PROGRAM_DIAGNOSTICS. This addresses issue #736, which requested a way to temporarily disable tsconfig validation errors when migrating large codebases that may have deprecated TypeScript configuration options while staying on older TypeScript versions.

Changes:

  • Added environment variable check in headless mode to suppress tsconfig-error diagnostics
  • Added e2e test to verify the suppression functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
cmd/tsgolint/headless.go Added environment variable check to suppress tsconfig-error diagnostics in the internal diagnostic handler
e2e/snapshot.test.ts Added test case to verify tsconfig-error diagnostics are suppressed when the environment variable is set

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@logaretm
Copy link
Contributor Author

logaretm commented Feb 24, 2026

I don't think this will work how you expect...

@camc314 I didn't realize that, the issue I guess is with invalid config the program produced is nil so I guess we are forced to skip them?

@logaretm
Copy link
Contributor Author

logaretm commented Feb 24, 2026

Never mind, I think I misunderstood what happens in that case. I think we can just ignore configParseResult.Errors when the flag is enabled.

I pushed a re-work of this that has the desired effect but now it also lints those projects files.

@logaretm logaretm requested a review from camc314 February 24, 2026 18:12
@logaretm
Copy link
Contributor Author

logaretm commented Mar 2, 2026

@camc314 Any chance we can take another look at this?

@logaretm
Copy link
Contributor Author

logaretm commented Mar 2, 2026

Thanks for the review, I addressed both comments 🙏

@logaretm logaretm force-pushed the awad/env-disable-tsconfig-error branch from 2ff1af2 to 944d6c0 Compare March 2, 2026 22:03
@logaretm
Copy link
Contributor Author

logaretm commented Mar 2, 2026

Weird, I didn't get those errors when I ran just ready initially, after rebasing I got the same errors as the CI.

I fixed them now.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@camc314 camc314 self-assigned this Mar 3, 2026
@camc314 camc314 changed the title feat: Add env variable to suppress tsconfig errors feat: add env var to suppress program diagnostics Mar 3, 2026
@camc314 camc314 enabled auto-merge (squash) March 3, 2026 11:22
@camc314 camc314 disabled auto-merge March 3, 2026 11:22
@camc314 camc314 enabled auto-merge (squash) March 3, 2026 11:24
@camc314 camc314 disabled auto-merge March 3, 2026 11:24
@camc314 camc314 enabled auto-merge (squash) March 3, 2026 11:25
@camc314 camc314 merged commit 1308ac4 into oxc-project:main Mar 3, 2026
7 checks passed
logaretm added a commit to getsentry/sentry-javascript that referenced this pull request Mar 6, 2026
Replaces eslint with oxlint, we had an outdated Eslint 8.x setup anyways
and we needed to either upgrade it or move to something else. Oxlint
brings so much speed gains given how slow linting is, and almost no one
is running it locally project wide because of how slow it is.

The changes can look like a lot but most of it is just:

- Comment Replacement due to rule name changes.
- Config file swapping (from `.eslintrc.js` to `.oxlintrc.json`

I downgraded a few rules, but they will be cleaned up in a follow up PR
in

## Benchmarks

### Overall

| Metric | Before (ESLint) | After (Oxlint) | Speedup |
|--------|-----------------|----------------|---------|
| CI Time | ~6 minutes | ~10 seconds | **36x**\* |

Note that:

- ~Lerna adds a considerable overhead that eats a lot of the gains we
can potentially get.~ We removed Lerna and also we will just lint the
entire project rather than go package by package.
- ~CI time is hogged by building types step~ Not relevant anymore,
typeaware mode works wonderfully after
[oxc-project/tsgolint#739](oxc-project/tsgolint#739)
was merged.

#### SDK Packages

| Package           | Files | ESLint | Oxlint | Speedup  |
| ----------------- | ----- | ------ | ------ | -------- |
| `core`            | 365   | 9.6s   | 53ms   | **181x** |
| `browser`         | 136   | 6.8s   | 55ms   | **124x** |
| `node`            | 105   | 6.1s   | 64ms   | **95x**  |
| `node-core`       | 101   | 6.2s   | 56ms   | **111x** |
| `nextjs`          | 181   | 10.9s  | 79ms   | **138x** |
| `sveltekit`       | 63    | 6.4s   | 71ms   | **90x**  |
| `opentelemetry`   | 58    | 4.3s   | 52ms   | **83x**  |
| `cloudflare`      | 43    | 3.8s   | 45ms   | **84x**  |
| `remix`           | 38    | 7.1s   | 42ms   | **169x** |
| `react`           | 39    | 6.5s   | 49ms   | **133x** |
| `feedback`        | 38    | 3.8s   | 48ms   | **79x**  |
| `replay-internal` | 152   | 5.6s   | 38ms   | **147x** |
| `vue`             | 24    | 4.0s   | 48ms   | **83x**  |
| `svelte`          | 15    | 4.0s   | 52ms   | **77x**  |
| `angular`         | 12    | 3.7s   | 37ms   | **100x** |

#### Dev Packages

| Package | Files | ESLint | Oxlint | Speedup |
| ------------------------------ | ----- | -------- | ------ | --------
|
| `browser-integration-tests` | 778 | 10.8s | 209ms | **52x** |
| `node-integration-tests` | 605 | 9.0s | 291ms | **31x** |
| `node-core-integration-tests` | 268 | 6.2s | 74ms | **84x** |
| `e2e-tests` | 10 | 2.6s | 44ms | **59x** |
| `cloudflare-integration-tests` | 27 | 2.5s | 35ms | **71x** |
| `test-utils` | 5 | 2.4s | 21ms | **114x** |
| `rollup-utils`                 | 13    | ❌ error | 22ms   | N/A      |
| `bundler-tests`                | 3     | ❌ error | 51ms   | N/A      |

---

closes #19222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support disabling/suppressing tsconfig-error rule

3 participants