Skip to content

Commit 41eea26

Browse files
authored
Merge pull request codeBelt#4 from codeBelt/clear-lint
clear lint
2 parents 8080c16 + b05bf37 commit 41eea26

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

src/models/IConstructor.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
// Interface style:
2-
export default interface IConstructor<T> extends Function {
3-
new (...args: any[]): T;
4-
}
5-
6-
// Union Type style:
7-
export type ConstructorUnion<T> = new (...args: any[]) => T;
2+
export type IConstructor<T> = new (...args: any[]) => T;

src/serviceWorker.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ const isLocalhost = Boolean(
1818
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)
1919
);
2020

21-
type Config = {
21+
interface IConfig {
2222
onSuccess?: (registration: ServiceWorkerRegistration) => void;
2323
onUpdate?: (registration: ServiceWorkerRegistration) => void;
24-
};
24+
}
2525

26-
export function register(config?: Config) {
26+
export function register(config?: IConfig) {
2727
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
2828
// The URL constructor is available in all browsers that support SW.
2929
const publicUrl = new URL((process as { env: { [key: string]: string } }).env.PUBLIC_URL, window.location.href);
@@ -44,7 +44,8 @@ export function register(config?: Config) {
4444
// Add some additional logging to localhost, pointing developers to the
4545
// service worker/PWA documentation.
4646
navigator.serviceWorker.ready.then(() => {
47-
console.log('This web app is being served cache-first by a service ' + 'worker. To learn more, visit https://bit.ly/CRA-PWA');
47+
/* tslint:disable-next-line no-console */
48+
console.log('This web app is being served cache-first by a service worker. To learn more, visit https://bit.ly/CRA-PWA');
4849
});
4950
} else {
5051
// Is not localhost. Just register service worker
@@ -54,7 +55,7 @@ export function register(config?: Config) {
5455
}
5556
}
5657

57-
function registerValidSW(swUrl: string, config?: Config) {
58+
function registerValidSW(swUrl: string, config?: IConfig) {
5859
navigator.serviceWorker
5960
.register(swUrl)
6061
.then((registration) => {
@@ -69,6 +70,7 @@ function registerValidSW(swUrl: string, config?: Config) {
6970
// At this point, the updated precached content has been fetched,
7071
// but the previous service worker will still serve the older
7172
// content until all client tabs are closed.
73+
/* tslint:disable-next-line no-console */
7274
console.log('New content is available and will be used when all ' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.');
7375

7476
// Execute callback
@@ -79,6 +81,7 @@ function registerValidSW(swUrl: string, config?: Config) {
7981
// At this point, everything has been precached.
8082
// It's the perfect time to display a
8183
// "Content is cached for offline use." message.
84+
/* tslint:disable-next-line no-console */
8285
console.log('Content is cached for offline use.');
8386

8487
// Execute callback
@@ -95,7 +98,7 @@ function registerValidSW(swUrl: string, config?: Config) {
9598
});
9699
}
97100

98-
function checkValidServiceWorker(swUrl: string, config?: Config) {
101+
function checkValidServiceWorker(swUrl: string, config?: IConfig) {
99102
// Check if the service worker can be found. If it can't reload the page.
100103
fetch(swUrl)
101104
.then((response) => {
@@ -114,6 +117,7 @@ function checkValidServiceWorker(swUrl: string, config?: Config) {
114117
}
115118
})
116119
.catch(() => {
120+
/* tslint:disable-next-line no-console */
117121
console.log('No internet connection found. App is running in offline mode.');
118122
});
119123
}

src/utilities/EffectUtility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import HttpUtility from './HttpUtility';
22
import { AxiosResponse } from 'axios';
3-
import IConstructor from '../models/IConstructor';
3+
import { IConstructor } from '../models/IConstructor';
44
import HttpErrorResponseModel from '../models/HttpErrorResponseModel';
55

66
export default class EffectUtility {

src/views/components/main-nav/MainNav.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { NavLink, NavLinkProps } from 'react-router-dom';
55
interface IProps {}
66
interface IState {}
77

8-
const Nav = (props: NavLinkProps) => <NavLink exact {...props} activeClassName="active" />;
8+
const Nav = (props: NavLinkProps) => <NavLink exact={true} {...props} activeClassName="active" />;
99

1010
export default class MainNav extends React.Component<IProps, IState> {
1111
public render(): JSX.Element {
1212
return (
13-
<Segment inverted>
14-
<Menu inverted pointing secondary>
13+
<Segment inverted={true}>
14+
<Menu inverted={true} pointing={true} secondary={true}>
1515
<Menu.Item as={Nav} to="/" name="home" />
1616
<Menu.Item as={Nav} to="/episodes" name="Episodes" />
1717
</Menu>

src/views/episodes-page/EpisodesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class EpisodesPage extends React.Component<IProps & IStateToProps & ReduxProps<a
4545
{model.rows.map((row: IEpisodeTableRow) => (
4646
<Table.Row key={row.episode}>
4747
<Table.Cell>
48-
<Image src={row.image} rounded size="small" />
48+
<Image src={row.image} rounded={true} size="small" />
4949
</Table.Cell>
5050
<Table.Cell>{row.episode}</Table.Cell>
5151
<Table.Cell>{row.date}</Table.Cell>

src/views/home-page/HomePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class HomePage extends React.Component<IProps & IStateToProps & ReduxProps<any,
3131
return (
3232
<div className={styles.wrapper}>
3333
<MainOverview />
34-
<Divider horizontal>
34+
<Divider horizontal={true}>
3535
<Header as="h4">
3636
<Icon name="users" /> Cast
3737
</Header>

0 commit comments

Comments
 (0)