-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tree Widget: Use type imports #475
Conversation
@@ -6,12 +6,15 @@ require("@rushstack/eslint-patch/modern-module-resolution"); | |||
|
|||
module.exports = { | |||
plugins: ["@itwin"], | |||
extends: "plugin:@itwin/ui", | |||
extends: ["plugin:@itwin/ui", "plugin:react/jsx-runtime"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this cause issues for apps? (i have no idea, but im in favor of removing the react import if possible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess its dependent on the tsconfig change you made?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should cause any issues for apps. This is React 17 feature.
Yes this eslint config change is needed to disable eslint rules that require React
to be imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So many similar formatting issues suggest something's not right with the tooling. I checked out the branch and checked:
@typescript-eslint/consistent-type-imports
, when fixing a problem, doesn't add the space, e.g.:gets "fixed" to:import { IFilteredPresentationTreeDataProvider, isPresentationTreeNodeItem } from "@itwin/presentation-components";
import type { IFilteredPresentationTreeDataProvider} from "@itwin/presentation-components"; import { isPresentationTreeNodeItem } from "@itwin/presentation-components";
- linter doesn't complain about these formatting problems, so doesn't fix them either
Anything we can do about it?
packages/itwin/tree-widget/src/components/trees/models-tree/ModelsVisibilityHandler.ts
Outdated
Show resolved
Hide resolved
packages/itwin/tree-widget/src/test/TreeWidgetComponent.test.tsx
Outdated
Show resolved
Hide resolved
packages/itwin/tree-widget/src/test/trees/CategoriesVisibilityUtils.test.ts
Outdated
Show resolved
Hide resolved
packages/itwin/tree-widget/src/components/TreeWidgetUiItemsProvider.tsx
Outdated
Show resolved
Hide resolved
packages/itwin/tree-widget/src/components/trees/VisibilityTreeRenderer.tsx
Outdated
Show resolved
Hide resolved
packages/itwin/tree-widget/src/components/trees/category-tree/CategoriesTree.tsx
Outdated
Show resolved
Hide resolved
packages/itwin/tree-widget/src/components/trees/category-tree/CategoriesTreeComponent.tsx
Outdated
Show resolved
Hide resolved
packages/itwin/tree-widget/src/components/trees/category-tree/CategoryVisibilityHandler.tsx
Outdated
Show resolved
Hide resolved
* Tree Widget: API cleanup (#426) * Clean up internal API * rush change * Tree-Widget: Rework how trees are added to widget (#428) * Refactor the way how trees a provided to widget * rush change * Highlight in changelog that these are breaking changes * Update common/changes/@itwin/tree-widget-react/rework_additional_trees_handling_2023-04-14-14-58.json Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> --------- Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> * Tree Widget: Add ability to conditionally show/hide trees in widget (#444) * Add ability to conditionally show trees in the widget * rush change * PR fixes * Tree-Widget: Fix invert button in categories tree (#434) * Fix invert button in categories tree * rush change * Pr comment fixes * Apply suggestions from code review Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> * more pr comment fixes * pr comment fixes * Apply suggestion from the code review Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * pr comment fixes * pr comment fixes --------- Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * Tree widget: README improvements (#451) * Add `IModelContentTreeComponent` to be consistent with other trees * Improve README * Apply suggestions from code review Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * rush update --------- Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * Fix merge * Tree widget: API extractions (#467) * Start extracting `tree-widget-react` API * Release tags & some docs * fix docs * Tree Widget: Add more unit tests (#469) * Add tests for TreeHeader and SearchBox * Better cleanup TreeHeader tests * Use EmptyLocalization for tests * Add TreeWidgetComponent tests * Add TreeFilteringState tests * Add TreeWidgetUiItemsProvider tests * Add TreeWidget tests * Cleanup AutoSizer * Localize search component * extract-api * Models tree: Hierarchy configuration (#473) * Generate ruleset dynamically * Add a way to specialize class of geometric elements loaded into models tree * Tree widget: Make changelogs consistent (#474) * Tree widget: External sources tree (#476) * Add external sources tree component (`@alpha`) * rush change * 100% coverage * Tree Widget: Use type imports (#475) * Use type imports * rush change * Fix object spacing * Fix new imports * IModel content: 100% coverage (#477) * External sources tree: Add missing attributes `id` and `getLabel` (#478) * Tree widget: Setup linter to cleanup unused type imports (#479) * Tree widget: add tests for categories and models tree (#482) * add tests * Apply suggestions from code review Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * Pr comment fixes * lint fix * Apply suggestions from code review Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * pr comment fixes * Update packages/itwin/tree-widget/src/test/trees/CategoriesVisibilityUtils.test.ts Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * pr comment fixes --------- Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * Require 100% test coverage (#486) * Tree Widget: Keep child nodes state the same after parent node re-expands (#492) * Keep child nodes state the same after parent node re-expanding * rush change * fix comment * Models Tree: Disable root node colapsing (#490) * disable expansion toggle for root node * rush change * Apply suggestions from code review Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * pr comment fixes --------- Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * Keep eye checkbox position static on horizontal scroll, make model and categories tree whitespace between eye checkbox and node label smalelr (#512) * Keep eye checkbox static on horizontal scroll and make whitespace between eye checkbox and node label smaller * Apply suggestions from code review Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> * pr comment and ui bug fixes * documentation fixes * Apply suggestions from code review Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * pr comment fixes * pr comment fixes * update changelogfile --------- Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com> * Tree widget: Use search box component from itwinui react (#515) * use itwinui searchbar * rush change * pr comment fixes * more pr comment fixes * Tree widget: Update dependencies (#519) * Update dependencies * Revive tests * Adjust styles * rush change * rush change * Tree widget: Update change types (#521) * Update change types * Update tree-widget version policy * Apply suggestions from code review Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> --------- Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> * Cleanup * Fix horizontal scrollbar hiding under other widgets * Update test-viewer deps * Update ExternalSources tree ruleset id * Use icon from `itwinui-icons-react` * Setup tree-widget for prerelease --------- Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com> Co-authored-by: simasjar <124659623+simasjar@users.noreply.github.com>
Closes #470
Added eslint rule to force consistent usage of type imports.
Switched to using JSX without importing React.