Repository navigation
refactor: enable noImplicitAny - #15027
Conversation
noImplicitAny
There was a problem hiding this comment.
Pull request overview
Enables TypeScript’s noImplicitAny within the packages/components workspace by removing the local override and updating component/test code to add explicit typings and safer narrowing/casting.
Changes:
- Removes the
noImplicitAny: falseoverride so the shared TS config’s stricter setting applies. - Adds explicit types and safer object/key access patterns across component code and test helpers.
- Adjusts a few runtime helpers to avoid unsafe dynamic property access (notably
openCloseComponent, though one change currently breaksopenPropsupport).
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/components/tsconfig.json | Removes noImplicitAny override |
| packages/components/src/utils/time.browser.spec.ts | Adds explicit param/return types |
| packages/components/src/utils/openCloseComponent.ts | Refactors open-state detection |
| packages/components/src/utils/logger.browser.spec.ts | Types globalThis test config |
| packages/components/src/utils/locale.browser.spec.ts | Safer typed key iteration |
| packages/components/src/utils/dom.browser.spec.tsx | Adds JSX factory import + param typing |
| packages/components/src/utils/config.browser.spec.ts | Types globals + focus-trap stack |
| packages/components/src/tests/commonTests/browser/themed.ts | Tightens CSS property typing |
| packages/components/src/tests/commonTests/browser/t9n.ts | Uses object matcher for overrides |
| packages/components/src/tests/commonTests/browser/reflects.ts | Safer key typing + assignment |
| packages/components/src/tests/commonTests/browser/open-close.ts | Avoids dynamic index assignment |
| packages/components/src/tests/commonTests/browser/internal-label.ts | Narrows _loading access |
| packages/components/src/tests/commonTests/browser/focus-trap.ts | Avoids dynamic index assignment |
| packages/components/src/tests/commonTests/browser/floating-ui.ts | Avoids dynamic index assignment |
| packages/components/src/tests/commonTests/browser/defaults.ts | Safer key typing + assertions |
| packages/components/src/controllers/useTime.ts | Removes dynamic localized key composition |
| packages/components/src/controllers/useForm/validation.ts | Uses explicit ValidityState key list |
| packages/components/src/components/tooltip/tooltip.browser.e2e.tsx | Narrows property to literal "open" |
| packages/components/src/components/tile/tile.tsx | Makes slot-change logic explicit + types ref |
| packages/components/src/components/text-area/text-area.e2e.ts | Adds missing numeric/event types |
| packages/components/src/components/table-row/table-row.tsx | Removes implicit-any field |
| packages/components/src/components/split-button/split-button.e2e.ts | Adds const assertions + typed iteration |
| packages/components/src/components/sort-handle/sort-handle.e2e.ts | Types E2EPage parameter |
| packages/components/src/components/slider/slider.tsx | Types internal fields + safer key iteration |
| packages/components/src/components/slider/slider.e2e.ts | Fixes awaited property indexing |
| packages/components/src/components/slider/slider.browser.e2e.tsx | Uses Object.entries destructuring |
| packages/components/src/components/sheet/sheet.browser.e2e.tsx | Adds explicit setup return type |
| packages/components/src/components/scrim/scrim.e2e.ts | Fixes implicit global via const |
| packages/components/src/components/pagination/pagination.e2e.ts | Uses Object.entries destructuring |
| packages/components/src/components/notice/notice.stories.ts | Types story helper parameters |
| packages/components/src/components/input-time-zone/utils.ts | Safe message lookup + narrows prop union |
| packages/components/src/components/input-time-zone/input-time-zone.tsx | Narrows timeZoneItems rendering branch |
| packages/components/src/components/input-time-picker/input-time-picker.tsx | Types mouse event handler |
| packages/components/src/components/graph/utils.browser.spec.ts | Types empty data series |
| packages/components/src/components/filter/filter.e2e.ts | Types page as E2EPage |
| packages/components/src/components/combobox/combobox.tsx | Adds explicit destructured param type |
| packages/components/src/components/color-picker/color-picker.tsx | Fixes dynamic key access + type safety |
| packages/components/src/components/color-picker/color-picker.browser.e2e.tsx | Safer iteration over object entries/values |
| packages/components/src/components/checkbox/checkbox.e2e.ts | Types helper function parameters |
| packages/components/src/components/carousel/carousel.tsx | Types timer handles properly |
| packages/components/src/components/card/card.tsx | Types pointer event handler |
| packages/components/src/components/button/button.e2e.ts | Avoids precedence pitfall in awaits |
| packages/components/src/components/action-menu/action-menu.tsx | Types click handler as MouseEvent |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/components/src/utils/openCloseComponent.ts:70
isOpencan returnundefinedbecause the default-state path readscomponent.openfrom an optional property. In practice, components using the defaultopenprop should always provide a boolean, and keepingisOpenasbooleanavoids propagating an unnecessary tri-state into the toggle logic.
packages/components/src/components/dialog/dialog.tsx:54- The class no longer explicitly implements the open/close transition contract used by
toggleOpenClose, which reduces compile-time guarantees that required fields (e.g.,transitionEl,opened,onBeforeOpen, etc.) stay in sync with the helper’s expectations. Consider keeping the explicitimplementswith the new generic open prop key.
export class Dialog extends LitElement {
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
packages/components/src/utils/dom.browser.spec.tsx:1
his imported but not used in this test file, which can trigger lint/TSnoUnusedLocalsfailures.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
packages/components/src/tests/commonTests/browser/internal-label.ts:89
- blocking:
messagesis captured once (const { messages } = t9nComponent) and then polled inside the interval. If the t9n controller replacest9nComponent.messagesduring loading (e.g., swapping in the resolved bundle), this loop will keep checking the stale object and can hang the test. Re-readt9nComponent.messagesinside the interval (or avoid destructuring) so the latest_loadingflag is observed.
df78136 to
ca945c1
Compare
ca945c1 to
c3fc5f2
Compare
c3fc5f2 to
64429c0
Compare
* origin/dev: (47 commits) refactor(useFormTrigger): move void controller to constructor (#15108) refactor(slider): use refs instead of DOM queries (#15096) test(slider): migrate tests to browser mode (#15095) refactor: enable `noImplicitAny` (#15027) chore: release next feat(block): add background color token (#15099) fix(tile): restore top/bottom slot spacing (#15101) build(deps): update dependency eslint to v10.9.1 (#15036) build(deps): update dependency eslint-plugin-storybook to v10.5.10 (#14807) build(deps): update dependency @eslint-react/eslint-plugin to v5.18.6 (#14722) build(deps): update dependency eslint-plugin-perfectionist to v5.10.1 (#14801) build(deps): update dependency @eslint-react/kit to v5.18.6 (#14723) refactor: apply `transition-default` mixin (#8851) chore: release next feat(block): deprecate `collapsible` in favor of `expandable` (#15091) chore: release next style(radio-button-group): apply linter fixes (#15085) fix(radio-button-group): sync group `disabled` only when set (#15084) refactor: derive a shared commonTests helper for scale propagation (#15073) chore: release next ...
monday.com sync: #12948178649
Related Issue: N/A
Summary
Enables
noImplicitAnyfor components.