Skip to content

[chore] Add rule to avoid duplicate fp-ts imports #218593

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

Merged
merged 5 commits into from
Apr 23, 2025

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Apr 17, 2025

Summary

This PR is the counter part of #217034 to avoid making the same mistake again in the future.

@dej611 dej611 added Team:Operations Team label for Operations Team release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Apr 17, 2025
@dej611 dej611 requested a review from a team as a code owner April 17, 2025 17:17
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@dej611 dej611 requested review from a team as code owners April 18, 2025 08:51
@botelastic botelastic bot added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Apr 18, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - elastic/security-defend-workflows team

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the Threat Hunting Investigations team

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obs ux management changes LGTM

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detection Engine changes are limited to use of Either (mainly in our Exceptions code) and LGTM.

Copy link
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

infra&services changes LGTM

.eslintrc.js Outdated
@@ -275,6 +275,14 @@ const RESTRICTED_IMPORTS = [
name: '@testing-library/react-hooks',
message: 'Please use @testing-library/react instead',
},
...['Option', 'pipeable', 'TaskEither', 'Either', 'function', 'Task', 'Set', 'Ord', 'Array'].map(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT

  • I searched through the codebase and found one more: NonEmptyArray.
  • Folks could also import directly from the lib/index.ts, e.g. import { either } from 'fp-ts/lib';
  • Going to the lib folder, I compiled the complete list:
['Alt', 'Alternative', 'Applicative', 'Apply', 'Array', 'Bifunctor', 'boolean', 'BooleanAlgebra', 'Bounded', 'BoundedDistributiveLattice', 'BoundedJoinSemilattice', 'BoundedLattice', 'BoundedMeetSemilattice', 'Category', 'Chain', 'ChainRec', 'Choice', 'Comonad', 'Compactable', 'Console', 'Const', 'Contravariant', 'Date', 'DistributiveLattice', 'Either', 'EitherT', 'Eq', 'Extend', 'Field', 'Filterable', 'FilterableWithIndex', 'Foldable', 'FoldableWithIndex', 'function', 'Functor', 'FunctorWithIndex', 'Group', 'HeytingAlgebra', 'Identity', 'Invariant', 'IO', 'IOEither', 'IORef', 'JoinSemilattice', 'Lattice', 'Magma', 'Map', 'MeetSemilattice', 'Monad', 'MonadIO', 'MonadTask', 'MonadThrow', 'Monoid', 'NonEmptyArray', 'Option', 'OptionT', 'Ord', 'Ordering', 'pipeable', 'Profunctor', 'Random', 'Reader', 'ReaderEither', 'ReaderT', 'ReaderTask', 'ReaderTaskEither', 'ReadonlyArray', 'ReadonlyMap', 'ReadonlyNonEmptyArray', 'ReadonlyRecord', 'ReadonlySet', 'ReadonlyTuple', 'Record', 'Ring', 'Semigroup', 'Semigroupoid', 'Semiring', 'Set', 'Show', 'State', 'StateReaderTaskEither', 'StateT', 'Store', 'Strong', 'Task', 'TaskEither', 'TaskThese', 'These', 'TheseT', 'Traced', 'Traversable', 'TraversableWithIndex', 'Tree', 'Tuple', 'Unfoldable', 'ValidationT', 'Witherable', 'Writer', 'WriterT']

Copy link
Contributor

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor remark, don't want to block the PR on that

@elasticmachine
Copy link
Contributor

elasticmachine commented Apr 23, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

@dej611 dej611 merged commit 20ad78d into elastic:main Apr 23, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:Operations Team label for Operations Team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.