-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[FE] Fix eslint and prettier errors #117
[FE] Fix eslint and prettier errors #117
Conversation
fetchBrokerMetrics, | ||
} from 'redux/actions'; | ||
import Brokers from './Brokers'; | ||
import { fetchBrokers, fetchBrokerMetrics } from 'redux/actions'; |
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.
why is it better?
{activeControllers} | ||
</Indicator> | ||
<Indicator label="Total Brokers">{brokerCount}</Indicator> | ||
<Indicator label="Active Controllers">{activeControllers}</Indicator> |
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.
why is it better?
params: { clusterName }, | ||
}, | ||
}: OwnProps | ||
) => ({ |
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.
why is it better? Somewhere you collapse objects, and somewhere you don't. What logic should we follow? only the length of the line?
className="title is-6 has-text-overflow-ellipsis" | ||
title={name} | ||
> | ||
<div className="title is-6 has-text-overflow-ellipsis" title={name}> |
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.
why is it better?
{chunk.map((cluster, idx) => ( | ||
<ClusterWidget {...cluster} key={`dashboard-cluster-list-item-key-${idx}`}/> | ||
{clusterList.map((chunkItem) => ( | ||
<div className="columns" key={v4()}> |
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.
why is it better? I believe v4 assigns new key for each <div>
every time, so it is useless. Moreover, it can cause uncontrolled re-renderings of elements
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.
Fixed it, replaced key value with unique fields. Unfortunately, not all of the data had it, so I added it to them.
kafka-ui-react-app/src/components/Topics/Details/Settings/Settings.tsx
Outdated
Show resolved
Hide resolved
kafka-ui-react-app/src/components/common/Breadcrumb/Breadcrumb.tsx
Outdated
Show resolved
Hide resolved
To avoid any confusions I would suggest to make config as strict as it possible |
import { | ||
getIsClusterListFetched, | ||
getClusterList, | ||
} from 'redux/reducers/clusters/selectors'; |
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.
Indeed, as @workshur mentioned it is not clear why we stretch the code over several lines here, while we collapse similar imports in other places.
This comment is just to draw your attention to the inconsistency.
Totally agree with @workshur about confusing line breaking strategy and uniq keys for list items. Everything else LGTM. |
…int-errors # Conflicts: # kafka-ui-react-app/package-lock.json # kafka-ui-react-app/src/components/Brokers/Brokers.tsx # kafka-ui-react-app/src/components/Brokers/BrokersContainer.ts # kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClusterWidget.tsx # kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx # kafka-ui-react-app/src/components/Topics/Details/DetailsContainer.ts # kafka-ui-react-app/src/components/Topics/Details/Messages/Messages.tsx # kafka-ui-react-app/src/components/Topics/List/ListItem.tsx # kafka-ui-react-app/src/components/Topics/New/NewContainer.ts # kafka-ui-react-app/src/components/Topics/TopicsContainer.ts # kafka-ui-react-app/src/redux/actions/actions.ts # kafka-ui-react-app/src/redux/api/clusters.ts # kafka-ui-react-app/src/redux/api/consumerGroups.ts # kafka-ui-react-app/src/redux/api/topics.ts # kafka-ui-react-app/src/redux/interfaces/broker.ts # kafka-ui-react-app/src/redux/interfaces/topic.ts # kafka-ui-react-app/src/redux/reducers/clusters/selectors.ts # kafka-ui-react-app/src/redux/reducers/topics/reducer.ts
…errors [FE] Fix eslint and prettier errors
This PR aims to fix existing Eslint and Prettier errors in the project
lint
,lint:fix
and commit hook ts check