-
Notifications
You must be signed in to change notification settings - Fork 840
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
[ESLINT] eslint-deprecation plugin implementation (#6914) #8198
base: main
Are you sure you want to change the base?
Changes from all commits
7e4d476
4d55f93
ac814e2
11ee9ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Cedgo1997 the changes on this PR are purely for development purposes (code quality). They do not contain any bug fixes, functionalities. Consumers don't have to be informed about them through changelog. So we can remove this file and add to the PR |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## [Unreleased] | ||
|
||
### Added | ||
- **eslint-plugin-deprecation v2.0.0:** | ||
- Integrated the `eslint-plugin-deprecation` to handle deprecation warnings. | ||
- Updated `.eslintrc.js` to include the new rule and plugin. | ||
|
||
### Updated | ||
- **Code Replacements for Deprecated Aliases:** | ||
- `toBeCalled` -> `toHaveBeenCalled` | ||
- `toBeCalledTimes` -> `toHaveBeenCalledTimes` | ||
- `toBeCalledWith` -> `toHaveBeenCalledWith` | ||
|
||
- **CSS Style Declarations:** | ||
- `clip` -> `clipPath` | ||
- `webkitUserSelect` -> `userSelect` | ||
|
||
- **Type Declarations:** | ||
- `HTMLTableHeaderCellElement` -> `HTMLTableCellElement` | ||
- `ClientRect` -> `DOMRect` (maintains compatibility but improves specificity). | ||
|
||
- **React-Specific Updates:** | ||
- Replaced `createStore` with `legacy_createStore`. | ||
- Updated type declarations to use `JSX` from React instead of global `JSX`. | ||
- Added `ReactChild` type declaration in `src/components/common.js` to handle deprecation. | ||
--- | ||
|
||
## Notes for Developers | ||
|
||
- **Plugin Compatibility:** | ||
- Used `eslint-plugin-deprecation` v2.0.0 as v3.0.0 appears to be incompatible with the current project setup. | ||
|
||
- **Pending Analysis:** | ||
- Some deprecations lack straightforward replacements and will need detailed investigation and follow-up issues. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { applyMiddleware, createStore, compose } from 'redux'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Cedgo1997 following the same logic as with the ESLint disable comments, maybe it'd be better to leave |
||
import { applyMiddleware, legacy_createStore, compose } from 'redux'; | ||
import thunk from 'redux-thunk'; | ||
|
||
import Routes from '../routes'; | ||
|
@@ -19,7 +19,7 @@ export default function configureStore(initialState) { | |
}; | ||
} | ||
|
||
return compose(applyMiddleware(thunk))(createStore)( | ||
return compose(applyMiddleware(thunk))(legacy_createStore)( | ||
rootReducer, | ||
initialState | ||
); | ||
|
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.
@Cedgo1997 how about we import JSX from
react
as it's done in other files for consistency?Same in:
packages/website/src/pages/index.tsx
packages/docusaurus-theme/src/theme/PaginatorNavLink/index.tsx
packages/docusaurus-theme/src/theme/TOCCollapsible/CollapseButton/index.tsx