Sort null, undefined and void in union types#34142
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces an ESLint rule to enforce consistent ordering of “nullish” members in TypeScript union types (primarily for .d.ts files), and updates existing declaration files to comply with that rule across the DevExtreme type surface (including the generated dx.all.d.ts bundle and framework wrapper typings).
Changes:
- Added
eslint-plugin-perfectionistto the workspace andpackages/devextreme, and enabledperfectionist/sort-union-typesforjs/**/*.d.ts. - Reordered union types in multiple
.d.tsfiles to placenull/undefined(and related “void” cases) at the end. - Propagated the updated type ordering into the Angular TreeList wrapper typings (
itemsExpr).
Reviewed changes
Copilot reviewed 4 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pnpm-workspace.yaml |
Adds eslint-plugin-perfectionist to the shared catalog for consistent dependency management. |
pnpm-lock.yaml |
Locks the newly added ESLint plugin (and its transitive deps) for reproducible installs. |
packages/devextreme/package.json |
Adds eslint-plugin-perfectionist as a devDependency used by the package ESLint config. |
packages/devextreme/eslint.config.mjs |
Enables perfectionist/sort-union-types for js/**/*.d.ts to enforce nullish union ordering. |
packages/devextreme/js/common/charts.d.ts |
Reorders unions (notably image/url) so undefined appears at the end. |
packages/devextreme/js/viz/polar_chart.d.ts |
Reorders unions so undefined is placed at the end for relevant members. |
packages/devextreme/js/common/grids.d.ts |
Reorders union return type to keep ordering consistent (`PromiseLike |
packages/devextreme/js/ui/card_view.d.ts |
Reorders union return type for setFieldValue for consistent union ordering. |
packages/devextreme/js/ui/tree_list.d.ts |
Reorders itemsExpr callback parameter union to move undefined to the end. |
packages/devextreme/js/ui/chat.d.ts |
Reorders unions so null is placed at the end for template options. |
packages/devextreme/js/format_helper.d.ts |
Reorders the format() input union to keep nullish types at the end. |
packages/devextreme/js/core/utils/type.d.ts |
Reorders isPrimitive type guard union to move nullish types to the end. |
packages/devextreme/js/core/renderer.d.ts |
Reorders renderer() parameter union for consistent type ordering. |
packages/devextreme/js/core/index.d.ts |
Reorders Scalar union to place `undefined |
packages/devextreme/ts/dx.all.d.ts |
Regenerates/updates the consolidated typings to reflect the new union ordering. |
packages/devextreme-angular/src/ui/tree-list/index.ts |
Aligns Angular wrapper itemsExpr typings with the updated core declaration signature. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
…Linter-null-type
anna-shakhova
previously approved these changes
Jun 26, 2026
marker-dao
previously approved these changes
Jun 26, 2026
pharret31
previously approved these changes
Jun 26, 2026
…Linter-null-type # Conflicts: # pnpm-lock.yaml
cc39441
bit-byte0
approved these changes
Jun 29, 2026
marker-dao
approved these changes
Jun 29, 2026
pharret31
approved these changes
Jun 29, 2026
siarhei-arzamasau
approved these changes
Jun 29, 2026
Raushen
added a commit
to Raushen/DevExtreme
that referenced
this pull request
Jun 29, 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.
No description provided.