misc linting

This commit is contained in:
Collin M. Barrett 2019-08-24 14:39:00 -05:00
parent cb04a7a786
commit e8854727e9
9 changed files with 32 additions and 33 deletions

View file

@ -1,6 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { App } from './App';
it('renders without crashing', () => {
const div = document.createElement('div');

View file

@ -5,24 +5,21 @@ import { AllListsTable } from './modules';
const { Header, Content, Footer } = Layout;
const App: React.FC = () => {
return (
<Layout>
<Header>
<Logo />
<Menu theme="dark" mode="horizontal" style={{ lineHeight: '64px' }} />
</Header>
<Content>
<div style={{ background: '#fff', paddingLeft: 12, paddingTop: 12, paddingRight: 12, minHeight: 280 }}>
<AllListsTable />
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>
<CopyrightAuthor /> | <Community /> | <GitHub /> | <Api /> | <Donate />
</Footer>
</Layout>
);
}
export const App: React.FC = () =>
<Layout>
<Header>
<Logo />
<Menu theme="dark" mode="horizontal" style={{ lineHeight: '64px' }} />
</Header>
<Content>
<div style={{ background: '#fff', paddingLeft: 12, paddingTop: 12, paddingRight: 12, minHeight: 280 }}>
<AllListsTable />
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>
<CopyrightAuthor /> | <Community /> | <GitHub /> | <Api /> | <Donate />
</Footer>
</Layout>;
const Logo = () =>
<img src="logo_filterlists.png"
@ -65,6 +62,4 @@ const Donate = () =>
title="Donate to FilterLists with Beerpay"
target="_blank" rel="noopener noreferrer">
Donate
</a>;
export default App;
</a>;

View file

@ -1,6 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';
import React from 'react';
import ReactDOM from 'react-dom';
import { App } from './App';
ReactDOM.render(<App />, document.getElementById('root'));

View file

@ -113,8 +113,8 @@ export class AllListsTable extends React.Component<{}, State> {
);
}
private tagSorter = (a: number[], b: number[], tags: Tag[]): number => {
return a && a.length
private tagSorter = (a: number[], b: number[], tags: Tag[]): number =>
a && a.length
? b && b.length
? a.length === b.length
? tags.filter((t: Tag) => a.indexOf(t.id) > -1).map((t: Tag) => t.name).join().toLowerCase() > tags.filter((t: Tag) => b.indexOf(t.id) > -1).map((t: Tag) => t.name).join().toLowerCase()
@ -125,7 +125,6 @@ export class AllListsTable extends React.Component<{}, State> {
: 1
: -1
: 1;
};
componentWillUnmount() {
window.removeEventListener('resize', this.updatePageSize);

View file

@ -1,3 +1,3 @@
import { AllListsTable } from './AllListsTable'
import { AllListsTable } from './AllListsTable';
export { AllListsTable }

View file

@ -1,3 +1,3 @@
import { AllListsTable } from './allListsTable'
import { AllListsTable } from './allListsTable';
export { AllListsTable }

View file

@ -1,6 +1,7 @@
import { Button, Dropdown, Menu } from 'antd';
import { ButtonProps, ButtonType } from "antd/lib/button";
import { ButtonProps, ButtonType } from 'antd/lib/button';
import React from 'react';
import styles from './SubscribeButton.module.css';
//TODO: import DropdownButtonType from antd rather than redefining if they export the type

View file

@ -1,5 +1,6 @@
import { Tag } from 'antd';
import React from 'react';
import styles from './TagCloud.module.css';
interface TagData {
@ -8,7 +9,7 @@ interface TagData {
};
interface Props {
tags?: TagData[]
tags: TagData[]
};
export const TagCloud = (props: Props): JSX.Element | null => {

View file

@ -1,3 +1,3 @@
import { nameof } from './nameof'
import { nameof } from './nameof';
export { nameof }