diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2024-04-18 08:18:36 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 08:18:36 -0600 |
commit | c49723056acec489765acb54bae3889ac07f25af (patch) | |
tree | 58bea705d61a728b060e615ce514b8d4a7936c9e /src/containers | |
parent | feat: hide all services workspace (#1713) (diff) | |
download | ferdium-app-c49723056acec489765acb54bae3889ac07f25af.tar.gz ferdium-app-c49723056acec489765acb54bae3889ac07f25af.tar.zst ferdium-app-c49723056acec489765acb54bae3889ac07f25af.zip |
refactor: bring down eslint warnings to zero (#1714)
- install `@eslint-react/eslint-plugin` dependency
- configure `@eslint-react/eslint-plugin` in eslint config
- modernize `lint` command in `package.json`
- disable or fix various reported lint issues
- fix `div` being nested in `p` for settings
- replace deprecated `event.keyCode` with `event.key`
- update isEscKeyPress method and unit tests which used deprecated `event.keyCode`
- allow `eslint` v8 as peer dependency for `@eslint-react/eslint-plugin`
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/auth/AuthReleaseNotesScreen.tsx | 1 | ||||
-rw-r--r-- | src/containers/download-manager/DownloadManagerScreen.tsx | 17 | ||||
-rw-r--r-- | src/containers/settings/EditServiceScreen.tsx | 4 | ||||
-rw-r--r-- | src/containers/settings/ReleaseNotesScreen.tsx | 18 | ||||
-rw-r--r-- | src/containers/settings/SupportScreen.tsx | 18 |
5 files changed, 26 insertions, 32 deletions
diff --git a/src/containers/auth/AuthReleaseNotesScreen.tsx b/src/containers/auth/AuthReleaseNotesScreen.tsx index 3191ba139..eac537ad6 100644 --- a/src/containers/auth/AuthReleaseNotesScreen.tsx +++ b/src/containers/auth/AuthReleaseNotesScreen.tsx | |||
@@ -43,6 +43,7 @@ class AuthReleaseNotesScreen extends Component<IProps, IState> { | |||
43 | intl, | 43 | intl, |
44 | ); | 44 | ); |
45 | 45 | ||
46 | // eslint-disable-next-line @eslint-react/no-set-state-in-component-did-mount | ||
46 | this.setState({ | 47 | this.setState({ |
47 | data, | 48 | data, |
48 | }); | 49 | }); |
diff --git a/src/containers/download-manager/DownloadManagerScreen.tsx b/src/containers/download-manager/DownloadManagerScreen.tsx index cd9686f4d..3413be37a 100644 --- a/src/containers/download-manager/DownloadManagerScreen.tsx +++ b/src/containers/download-manager/DownloadManagerScreen.tsx | |||
@@ -1,15 +1,12 @@ | |||
1 | import { Component, type ReactElement } from 'react'; | ||
2 | import DownloadManager from '../../components/downloadManager/DownloadManagerDashboard'; | 1 | import DownloadManager from '../../components/downloadManager/DownloadManagerDashboard'; |
3 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 2 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
4 | 3 | ||
5 | class DownloadManagerScreen extends Component { | 4 | const DownloadManagerScreen = ({ ...props }) => { |
6 | render(): ReactElement { | 5 | return ( |
7 | return ( | 6 | <ErrorBoundary> |
8 | <ErrorBoundary> | 7 | <DownloadManager {...props} /> |
9 | <DownloadManager {...this.props} /> | 8 | </ErrorBoundary> |
10 | </ErrorBoundary> | 9 | ); |
11 | ); | 10 | }; |
12 | } | ||
13 | } | ||
14 | 11 | ||
15 | export default DownloadManagerScreen; | 12 | export default DownloadManagerScreen; |
diff --git a/src/containers/settings/EditServiceScreen.tsx b/src/containers/settings/EditServiceScreen.tsx index dde69ef2d..f3b9b0857 100644 --- a/src/containers/settings/EditServiceScreen.tsx +++ b/src/containers/settings/EditServiceScreen.tsx | |||
@@ -141,13 +141,17 @@ class EditServiceScreen extends Component<IProps> { | |||
141 | const { action } = this.props.params; | 141 | const { action } = this.props.params; |
142 | const { recipes, services } = this.props.stores; | 142 | const { recipes, services } = this.props.stores; |
143 | const { createService, updateService } = this.props.actions.service; | 143 | const { createService, updateService } = this.props.actions.service; |
144 | // eslint-disable-next-line no-param-reassign | ||
144 | data.darkReaderSettings = { | 145 | data.darkReaderSettings = { |
145 | brightness: data.darkReaderBrightness, | 146 | brightness: data.darkReaderBrightness, |
146 | contrast: data.darkReaderContrast, | 147 | contrast: data.darkReaderContrast, |
147 | sepia: data.darkReaderSepia, | 148 | sepia: data.darkReaderSepia, |
148 | }; | 149 | }; |
150 | // eslint-disable-next-line no-param-reassign | ||
149 | delete data.darkReaderContrast; | 151 | delete data.darkReaderContrast; |
152 | // eslint-disable-next-line no-param-reassign | ||
150 | delete data.darkReaderBrightness; | 153 | delete data.darkReaderBrightness; |
154 | // eslint-disable-next-line no-param-reassign | ||
151 | delete data.darkReaderSepia; | 155 | delete data.darkReaderSepia; |
152 | 156 | ||
153 | const serviceData = data; | 157 | const serviceData = data; |
diff --git a/src/containers/settings/ReleaseNotesScreen.tsx b/src/containers/settings/ReleaseNotesScreen.tsx index 482364817..3a7b8d0e9 100644 --- a/src/containers/settings/ReleaseNotesScreen.tsx +++ b/src/containers/settings/ReleaseNotesScreen.tsx | |||
@@ -1,16 +1,12 @@ | |||
1 | import { Component, type ReactElement } from 'react'; | ||
2 | |||
3 | import ReleaseNotes from '../../components/settings/releaseNotes/ReleaseNotesDashboard'; | 1 | import ReleaseNotes from '../../components/settings/releaseNotes/ReleaseNotesDashboard'; |
4 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 2 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
5 | 3 | ||
6 | class ReleaseNotesScreen extends Component { | 4 | const ReleaseNotesScreen = () => { |
7 | render(): ReactElement { | 5 | return ( |
8 | return ( | 6 | <ErrorBoundary> |
9 | <ErrorBoundary> | 7 | <ReleaseNotes /> |
10 | <ReleaseNotes /> | 8 | </ErrorBoundary> |
11 | </ErrorBoundary> | 9 | ); |
12 | ); | 10 | }; |
13 | } | ||
14 | } | ||
15 | 11 | ||
16 | export default ReleaseNotesScreen; | 12 | export default ReleaseNotesScreen; |
diff --git a/src/containers/settings/SupportScreen.tsx b/src/containers/settings/SupportScreen.tsx index 4c50869bb..3fdb0b4df 100644 --- a/src/containers/settings/SupportScreen.tsx +++ b/src/containers/settings/SupportScreen.tsx | |||
@@ -1,16 +1,12 @@ | |||
1 | import { Component, type ReactElement } from 'react'; | ||
2 | |||
3 | import SupportFerdium from '../../components/settings/supportFerdium/SupportFerdiumDashboard'; | 1 | import SupportFerdium from '../../components/settings/supportFerdium/SupportFerdiumDashboard'; |
4 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 2 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
5 | 3 | ||
6 | class SupportScreen extends Component { | 4 | const SupportScreen = () => { |
7 | render(): ReactElement { | 5 | return ( |
8 | return ( | 6 | <ErrorBoundary> |
9 | <ErrorBoundary> | 7 | <SupportFerdium /> |
10 | <SupportFerdium /> | 8 | </ErrorBoundary> |
11 | </ErrorBoundary> | 9 | ); |
12 | ); | 10 | }; |
13 | } | ||
14 | } | ||
15 | 11 | ||
16 | export default SupportScreen; | 12 | export default SupportScreen; |