Skip to content

JS-1789 - S4782 resolve type alias#7135

Open
guillemsarda wants to merge 3 commits into
masterfrom
feat/JS-1789-S4782-resolve-types
Open

JS-1789 - S4782 resolve type alias#7135
guillemsarda wants to merge 3 commits into
masterfrom
feat/JS-1789-S4782-resolve-types

Conversation

@guillemsarda
Copy link
Copy Markdown
Contributor

@guillemsarda guillemsarda commented May 29, 2026

Part of JS-1789


Summary by Gitar

  • Rule logic enhancements:
    • Updated S4782 to resolve type aliases using ts.TypeChecker to identify undefined types.
    • Improved getUndefinedTypeAnnotation to handle TSTypeReference for indirect type definitions.
  • Test suite updates:
    • Added extensive test cases for nested, recursive, and aliased types in unit.test.ts.
    • Enabled strictNullChecks: true in the test tsconfig.json to ensure accurate type analysis.
  • Baseline updates:
    • Updated expected ruling results for ant-design, vuetify, vitest, and eigen projects.

This will update automatically on new commits.

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented May 29, 2026

JS-1789

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Ruling Report

New issues flagged (35 issues)

S4782

ant-design/components/button/button-group.tsx:8

     6 | 
     7 | export interface ButtonGroupProps {
>    8 |   size?: SizeType;
     9 |   style?: React.CSSProperties;
    10 |   className?: string;

ant-design/components/button/button.tsx:105

   103 |    */
   104 |   shape?: ButtonShape;
>  105 |   size?: SizeType;
   106 |   disabled?: boolean;
   107 |   loading?: boolean | { delay?: number };

ant-design/components/cascader/index.tsx:104

   102 | export type CascaderProps<DataNodeType> = UnionCascaderProps & {
   103 |   multiple?: boolean;
>  104 |   size?: SizeType;
   105 |   disabled?: boolean;
   106 |   bordered?: boolean;

ant-design/components/collapse/Collapse.tsx:32

    30 |   prefixCls?: string;
    31 |   expandIcon?: (panelProps: PanelProps) => React.ReactNode;
>   32 |   expandIconPosition?: ExpandIconPosition;
    33 |   ghost?: boolean;
    34 |   collapsible?: CollapsibleType;

ant-design/components/config-provider/DisabledContext.tsx:8

     6 | 
     7 | export interface DisabledContextProps {
>    8 |   disabled?: DisabledType;
     9 |   children?: React.ReactNode;
    10 | }

ant-design/components/config-provider/SizeContext.tsx:8

     6 | 
     7 | export interface SizeContextProps {
>    8 |   size?: SizeType;
     9 |   children?: React.ReactNode;
    10 | }

ant-design/components/config-provider/context.tsx:41

    39 |     ghost: boolean;
    40 |   };
>   41 |   direction?: DirectionType;
    42 |   space?: {
    43 |     size?: SizeType | number;

ant-design/components/config-provider/index.tsx:83

    81 |     ghost: boolean;
    82 |   };
>   83 |   componentSize?: SizeType;
    84 |   componentDisabled?: boolean;
    85 |   direction?: DirectionType;

ant-design/components/config-provider/index.tsx:85

    83 |   componentSize?: SizeType;
    84 |   componentDisabled?: boolean;
>   85 |   direction?: DirectionType;
    86 |   space?: {
    87 |     size?: SizeType | number;

ant-design/components/date-picker/generatePicker/index.tsx:82

    80 | > & {
    81 |   locale?: PickerLocale;
>   82 |   size?: SizeType;
    83 |   placement?: DataPickerPlacement;
    84 |   bordered?: boolean;

...and 25 more

📋 View full report

New issues flagged (35)

S4782

@sonarqube-next
Copy link
Copy Markdown

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 29, 2026

Code Review ✅ Approved

Enhanced S4782 to resolve type aliases using the TS TypeChecker and enabled strict null checks for more precise undefined type detection. Extensive test cases were added to validate nested, recursive, and aliased type handling.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

1 participant