[ESLINT] eslint-deprecation plugin implementation (#6914) #8198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR provides:
This PR doesn't contain:
@deprecated
decorator.Implementation:
eslint-plugin-deprecation v2.0.0 (v3.0.0 is not compatible)
.eslintrc.js updated with new rule and plugin added to handle deprecation warns:
Replaced/updated code
Replaced Deprecated Aliases:
toBeCalled
->toHaveBeenCalled
toBeCalledTimes
->toHaveBeenCalledTimes
toBeCalledWith
->toHaveBeenCalledWith
Replaced css style declarations:
clip
->clipPath
webkitUserSelect
->userSelect
Replaced deprecated type declarations:
HTMLTableHeaderCellElement
->HTMLTableCellElement
Others replacements:
createStore
withlegacy_createStore
as adviced.ClientRect
withDomRect
,ClientRect
inherits fromDOMRect
, which is perfectly compatible, but less specific.JSX
imported fromReact
instead of globalJSX
.ReactChild
type declaration insrc/components/common.js
to handle ReactChild deprecation alternative (Type was extracted by original declaration from react).Pending deprecate code (Recommended to open a new issue):
color
prop from_breadcrumb_content.tsx
.useColorStopsState
reported as deprecated.document.execCommand
is reported as deprecated, however, there isn't a known alternative to it.hasDragDrop
frompopover.tsx
.Goal
fromelastic_charts
mark as deprecated by plugin but alternative may require further analysis.EuiFilterSelectItem
andEuiFilterSelectItemClass
are reported as deprecated.PlayFunctionContext
from'@storybook/csf'
is marked as deprecated.name
prop frombutton_group.tsx
.QA
Remove or strikethrough items that do not apply to your PR.
General checklist
@default
if default values are missing) and playground toggles