Fix(orval) improve @orval/orval code quality#2936
Merged
melloware merged 12 commits intoorval-labs:masterfrom Feb 10, 2026
Merged
Fix(orval) improve @orval/orval code quality#2936melloware merged 12 commits intoorval-labs:masterfrom
melloware merged 12 commits intoorval-labs:masterfrom
Conversation
- Run eslint --fix: 44 auto-fixable violations resolved (import sort, no-useless-undefined, no-negated-condition, prefer-string-raw, prefer-string-replace-all) - Convert 9 prefer-nullish-coalescing violations from || to ?? (options.ts: 8 locations, tsconfig.ts: 1 location) - All conversions verified safe by type analysis
…-zod-specs.ts - Replace isObject() ternaries with direct .body access (4 locations) - Remove unused isObject import
- Replace queryOptions?. with queryOptions. (6 fixes) - Replace zod?. with zod. in truthy ternary (3 fixes) - Fix override?.formUrlEncoded in isBoolean branch - Fix override?.header! in isFunction branch - Remove dead ?? false from mutator.default expression
…specs, api, client - write-specs.ts: replace exhaustive else-if with else for zod schema type - write-specs.ts: remove always-truthy guard on verbOptions - api.ts: remove always-truthy guard on props (GetterProp[]) - client.ts: remove unreachable !generator guard
…types.ts - NormalizedQueryOptions.options: any -> Record<string, unknown> - QueryOptions.options: any -> Record<string, unknown> - NormalizedOverrideOutput.requestOptions: Record<string, any> -> Record<string, unknown> - OverrideOutput.requestOptions: Record<string, any> -> Record<string, unknown>
…te-specs - tsconfig.ts: assert tsconfck returns as Tsconfig (3 unsafe-return/assignment) - request.ts: type chunk as Buffer, assert JSON.parse as T, reject with Error (5 violations) - client.ts: replace any with string[], Function with ClientMockBuilder (2 violations) - write-specs.ts: null->undefined, remove useless default, remove useless switch case (3 violations)
- Change isPackageJson parameter from any to unknown - Replace Record<string, any> with Record<string, unknown> for yaml.load - Type fs.readJson return as Record<string, unknown> - Add CatalogData assertions on return values - Remove unnecessary optional chain on non-nullish pkg
- Replace 10 'as any' casts on fs.readFile mock values with Buffer.from() - Eliminates 10 no-explicit-any and 10 no-unsafe-argument violations - Only deferred require-await violations remain in test file
…compliance - Change dereferenceExternalRef signature from object to Record<string, unknown> - Assert x-ext extensions as Record<string, unknown> for typed access - Replace .sort() with .toSorted() in write-zod-specs index generation - Add OpenAPI bridge assertions for requestBody and parameters in write-zod-specs - Use type guard filters for query/header params with OpenApiParameterObject - Remove unused SchemaGenerationType import from options.ts
…liance - Cast test results to inline types matching expected structure - Use Record<string, unknown> for schema access patterns - Add local type aliases for deeply nested path/response assertions - Zero any-related violations remaining in import-specs.test.ts
- Remove async from 20 mockImplementation callbacks (require-await) - Remove unused imports destructure in api.ts (no-unused-vars) - Convert reduce to for..of loop in api.ts (no-array-reduce) - Convert reduce to for..of loop in options.ts (no-array-reduce)
- Add yarn workspace orval lint to .github/workflows/tests.yaml lint step - Remove --filter=!orval from root package.json turbo lint command
3fae0a6 to
ac530cd
Compare
Collaborator
|
cc @snebjorn ! |
melloware
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#closes #2555
Resolves all 185 ESLint violations (147 errors, 38 warnings) in
packages/orval/and adds the package to CI lint enforcement.What changed
prefer-nullish-coalescing,@typescript-eslint/prefer-optional-chain, etc.anyoperations: Replacedanywith proper OpenAPI types from@orval/core(Record<string, unknown>forQueryOptions.options/requestOptions, typedOpenApiSchemaObject/OpenApiParameterObjectin spec handling)Array.reducetofor...ofloops, removed unnecessaryasyncfrom test mocksyarn workspace orval lintto.github/workflows/tests.yaml, removed--filter=!orvalfrom root turbo lintApproach
typeof,inchecks) over type assertionseslint-disablecomments added