feat: add env var to suppress program diagnostics#739
feat: add env var to suppress program diagnostics#739camc314 merged 11 commits intooxc-project:mainfrom
Conversation
camc314
left a comment
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@camc314 I didn't realize that, the issue I guess is with invalid config the program produced is |
|
Never mind, I think I misunderstood what happens in that case. I think we can just ignore I pushed a re-work of this that has the desired effect but now it also lints those projects files. |
|
@camc314 Any chance we can take another look at this? |
|
Thanks for the review, I addressed both comments 🙏 |
2ff1af2 to
944d6c0
Compare
|
Weird, I didn't get those errors when I ran I fixed them now. |
…STICS to make it clear it shouldnt be relied upon
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
Adds
OXLINT_TSGOLINT_SUPPRESS_PROGRAM_DIAGNOSTICSenv variable check to suppress errors coming out oftsconfig-errordiagnostics.Usage:
OXLINT_TSGOLINT_SUPPRESS_PROGRAM_DIAGNOSTICS=true pnpm oxlint . --type-awarecloses #736