-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[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
Conversation
Pinging @elastic/kibana-operations (Team:Operations) |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
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.
LGTM - elastic/security-defend-workflows
team
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.
LGTM for the Threat Hunting Investigations team
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.
Obs ux management changes LGTM
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.
Detection Engine changes are limited to use of Either
(mainly in our Exceptions code) and LGTM.
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.
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( |
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.
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']
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.
One minor remark, don't want to block the PR on that
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
|
Summary
This PR is the counter part of #217034 to avoid making the same mistake again in the future.