From e8854727e98ef0fcb62a11a0f785660d0bcfbe9c Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 24 Aug 2019 14:39:00 -0500 Subject: [PATCH] misc linting --- src/FilterLists.Web.V2/src/App.test.tsx | 3 +- src/FilterLists.Web.V2/src/App.tsx | 37 ++++++++----------- src/FilterLists.Web.V2/src/index.tsx | 8 ++-- .../modules/allListsTable/AllListsTable.tsx | 5 +-- .../src/modules/allListsTable/index.ts | 2 +- src/FilterLists.Web.V2/src/modules/index.ts | 2 +- .../buttons/subscribe/SubscribeButton.tsx | 3 +- .../src/shared/tagCloud/TagCloud.tsx | 3 +- src/FilterLists.Web.V2/src/utils/index.ts | 2 +- 9 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/FilterLists.Web.V2/src/App.test.tsx b/src/FilterLists.Web.V2/src/App.test.tsx index a754b201b..7ca229b98 100644 --- a/src/FilterLists.Web.V2/src/App.test.tsx +++ b/src/FilterLists.Web.V2/src/App.test.tsx @@ -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'); diff --git a/src/FilterLists.Web.V2/src/App.tsx b/src/FilterLists.Web.V2/src/App.tsx index 067710e56..c7dfcc82a 100644 --- a/src/FilterLists.Web.V2/src/App.tsx +++ b/src/FilterLists.Web.V2/src/App.tsx @@ -5,24 +5,21 @@ import { AllListsTable } from './modules'; const { Header, Content, Footer } = Layout; -const App: React.FC = () => { - return ( - -
- - -
- -
- -
-
-
- | | | | -
-
- ); -} +export const App: React.FC = () => + +
+ + +
+ +
+ +
+
+
+ | | | | +
+
; const Logo = () => title="Donate to FilterLists with Beerpay" target="_blank" rel="noopener noreferrer"> Donate - ; - -export default App; \ No newline at end of file + ; \ No newline at end of file diff --git a/src/FilterLists.Web.V2/src/index.tsx b/src/FilterLists.Web.V2/src/index.tsx index c9a1418bf..8fec59ed5 100644 --- a/src/FilterLists.Web.V2/src/index.tsx +++ b/src/FilterLists.Web.V2/src/index.tsx @@ -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(, document.getElementById('root')); \ No newline at end of file diff --git a/src/FilterLists.Web.V2/src/modules/allListsTable/AllListsTable.tsx b/src/FilterLists.Web.V2/src/modules/allListsTable/AllListsTable.tsx index 3e03ff4f3..65fa396cf 100644 --- a/src/FilterLists.Web.V2/src/modules/allListsTable/AllListsTable.tsx +++ b/src/FilterLists.Web.V2/src/modules/allListsTable/AllListsTable.tsx @@ -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); diff --git a/src/FilterLists.Web.V2/src/modules/allListsTable/index.ts b/src/FilterLists.Web.V2/src/modules/allListsTable/index.ts index fd3e7fb18..35e7597f6 100644 --- a/src/FilterLists.Web.V2/src/modules/allListsTable/index.ts +++ b/src/FilterLists.Web.V2/src/modules/allListsTable/index.ts @@ -1,3 +1,3 @@ -import { AllListsTable } from './AllListsTable' +import { AllListsTable } from './AllListsTable'; export { AllListsTable } \ No newline at end of file diff --git a/src/FilterLists.Web.V2/src/modules/index.ts b/src/FilterLists.Web.V2/src/modules/index.ts index 820f33938..5b656626f 100644 --- a/src/FilterLists.Web.V2/src/modules/index.ts +++ b/src/FilterLists.Web.V2/src/modules/index.ts @@ -1,3 +1,3 @@ -import { AllListsTable } from './allListsTable' +import { AllListsTable } from './allListsTable'; export { AllListsTable } \ No newline at end of file diff --git a/src/FilterLists.Web.V2/src/shared/buttons/subscribe/SubscribeButton.tsx b/src/FilterLists.Web.V2/src/shared/buttons/subscribe/SubscribeButton.tsx index 23d116a48..41a587c36 100644 --- a/src/FilterLists.Web.V2/src/shared/buttons/subscribe/SubscribeButton.tsx +++ b/src/FilterLists.Web.V2/src/shared/buttons/subscribe/SubscribeButton.tsx @@ -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 diff --git a/src/FilterLists.Web.V2/src/shared/tagCloud/TagCloud.tsx b/src/FilterLists.Web.V2/src/shared/tagCloud/TagCloud.tsx index 80b71d07a..cf45551f7 100644 --- a/src/FilterLists.Web.V2/src/shared/tagCloud/TagCloud.tsx +++ b/src/FilterLists.Web.V2/src/shared/tagCloud/TagCloud.tsx @@ -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 => { diff --git a/src/FilterLists.Web.V2/src/utils/index.ts b/src/FilterLists.Web.V2/src/utils/index.ts index 47426d11c..61acd744c 100644 --- a/src/FilterLists.Web.V2/src/utils/index.ts +++ b/src/FilterLists.Web.V2/src/utils/index.ts @@ -1,3 +1,3 @@ -import { nameof } from './nameof' +import { nameof } from './nameof'; export { nameof } \ No newline at end of file