chore: fix few more linting issues

This commit is contained in:
Vishwas Shashidhar 2021-01-29 13:39:26 +05:30
parent 396dc4e950
commit adf13cc100
9 changed files with 50 additions and 8 deletions

View File

@ -23,6 +23,7 @@
"demo": "run-os",
"demo:win32": "npm run prebuild && cross-env ELECTRON_DEV=true electron . --url=file:///src/demo/index.html",
"demo:darwin": "npm run prebuild && cross-env ELECTRON_DEV=true electron . --url=file://$(pwd)/src/demo/index.html",
"format": "pretty-quick",
"lint": "run-s lint:*",
"lint:project": "tslint --project tsconfig.json",
"lint:spec": "tslint --project tsconfig.spec.json",

View File

@ -72,7 +72,7 @@ export default class AboutApp extends React.Component<{}, IState> {
}
/**
* main render function
* Renders the component
*/
public render(): JSX.Element {
const {
@ -144,10 +144,16 @@ export default class AboutApp extends React.Component<{}, IState> {
);
}
/**
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
ipcRenderer.on('about-app-data', this.updateState);
}
/**
* Callback to handle event when a component is unmounted
*/
public componentWillUnmount(): void {
ipcRenderer.removeListener('about-app-data', this.updateState);
}

View File

@ -32,16 +32,22 @@ export default class BasicAuth extends React.Component<{}, IState> {
this.updateState = this.updateState.bind(this);
}
/**
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
ipcRenderer.on('basic-auth-data', this.updateState);
}
/**
* Callback to handle event when a component is unmounted
*/
public componentWillUnmount(): void {
ipcRenderer.removeListener('basic-auth-data', this.updateState);
}
/**
* main render function
* Renders the component
*/
public render(): JSX.Element {
const { hostname, isValidCredentials } = this.state;

View File

@ -28,16 +28,22 @@ export default class LoadingScreen extends React.Component<{}, IState> {
this.updateState = this.updateState.bind(this);
}
/**
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
ipcRenderer.on('loading-screen-data', this.updateState);
}
/**
* Callback to handle event when a component is unmounted
*/
public componentWillUnmount(): void {
ipcRenderer.removeListener('loading-screen-data', this.updateState);
}
/**
* main render function
* Renders the component
*/
public render(): JSX.Element {
const { error } = this.state;

View File

@ -92,17 +92,23 @@ export default class NotificationComp extends React.Component<{}, IState> {
this.input = React.createRef();
}
/**
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
ipcRenderer.on('notification-data', this.updateState);
}
/**
* Callback to handle event when a component is unmounted
*/
public componentWillUnmount(): void {
ipcRenderer.removeListener('notification-data', this.updateState);
this.clearFlashInterval();
}
/**
* Renders the custom title bar
* Renders the component
*/
public render(): JSX.Element {
const {

View File

@ -63,6 +63,9 @@ export default class ScreenPicker extends React.Component<{}, IState> {
this.renderTabTitles = this.renderTabTitles.bind(this);
}
/**
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
ipcRenderer.on('screen-picker-data', this.updateState);
document.addEventListener('keyup', this.handleKeyUpPress, true);
@ -71,13 +74,16 @@ export default class ScreenPicker extends React.Component<{}, IState> {
}
}
/**
* Callback to handle event when a component is unmounted
*/
public componentWillUnmount(): void {
ipcRenderer.removeListener('screen-picker-data', this.updateState);
document.removeEventListener('keyup', this.handleKeyUpPress, true);
}
/**
* main render function
* Renders the component
*/
public render(): JSX.Element {
const { sources, selectedSource } = this.state;

View File

@ -35,7 +35,7 @@ export default class ScreenSharingIndicator extends React.Component<
}
/**
* main render function
* Renders the component
*/
public render(): JSX.Element {
const { id } = this.state;
@ -64,10 +64,16 @@ export default class ScreenSharingIndicator extends React.Component<
);
}
/**
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
ipcRenderer.on('screen-sharing-indicator-data', this.updateState);
}
/**
* Callback to handle event when a component is unmounted
*/
public componentWillUnmount(): void {
ipcRenderer.removeListener(
'screen-sharing-indicator-data',

View File

@ -50,6 +50,9 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
);
}
/**
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
const target = document.querySelector('title');
this.observer = new MutationObserver((mutations) => {
@ -72,6 +75,9 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
}, 10000);
}
/**
* Callback to handle event when a component is unmounted
*/
public componentWillUnmount(): void {
if (this.observer) {
this.observer.disconnect();
@ -79,7 +85,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
}
/**
* Renders the custom title bar
* Renders the component
*/
public render(): JSX.Element | null {
const { title, isFullScreen } = this.state;

View File

@ -23,7 +23,6 @@
],
"no-empty": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-implicit-dependencies": [true, "dev", "optional"],
"no-object-literal-type-assertion": false,
"no-var-requires": true,