Set tslint semicolon rule and aply it to the project
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 13 Jun 2018 06:44:01 +0000 (08:44 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 13 Jun 2018 06:44:01 +0000 (08:44 +0200)
Feature #13590

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

15 files changed:
src/components/api-token/api-token.tsx
src/components/breadcrumbs/breadcrumbs.tsx
src/components/main-app-bar/dropdown-menu/dropdown-menu.tsx
src/components/main-app-bar/main-app-bar.tsx
src/components/main-app-bar/search-bar/search-bar.test.tsx
src/components/main-app-bar/search-bar/search-bar.tsx
src/components/project-list/project-list.tsx
src/components/project-tree/project-tree.tsx
src/components/tree/tree.tsx
src/services/auth-service/auth-service.ts
src/services/project-service/project-service.ts
src/store/auth/auth-reducer.ts
src/store/store.ts
src/views/workbench/workbench.tsx
tslint.json

index 87da39b025e9706c05ebdade6e600f936fae1a89..b6616d38bf4942ad5d8442b29fb02ad8de95c608 100644 (file)
@@ -17,7 +17,7 @@ class ApiToken extends React.Component<ApiTokenProps & RouteProps & DispatchProp
         const regex = new RegExp('[\\?&]' + safeName + '=([^&#]*)');
         const results = regex.exec(search);
         return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
-    };
+    }
 
     componentDidMount() {
         const search = this.props.location ? this.props.location.search : "";
@@ -27,7 +27,7 @@ class ApiToken extends React.Component<ApiTokenProps & RouteProps & DispatchProp
         this.props.dispatch(projectService.getProjectList());
     }
     render() {
-        return <Redirect to="/"/>
+        return <Redirect to="/"/>;
     }
 }
 
index 6c2d1fb22afeaf4127d19338ebb307b48abb4f54..a3f9462e9ad2d11bfa9614b05351d73bfceed955 100644 (file)
@@ -8,15 +8,15 @@ import ChevronRightIcon from '@material-ui/icons/ChevronRight';
 import { withStyles } from '@material-ui/core';
 
 export interface Breadcrumb {
-    label: string
+    label: string;
 }
 
 interface BreadcrumbsDataProps {
-    items: Breadcrumb[]
+    items: Breadcrumb[];
 }
 
 interface BreadcrumbsActionProps {
-    onClick: (breadcrumb: Breadcrumb) => any
+    onClick: (breadcrumb: Breadcrumb) => any;
 }
 
 type BreadcrumbsProps = BreadcrumbsDataProps & BreadcrumbsActionProps & WithStyles<CssRules>;
@@ -51,29 +51,29 @@ class Breadcrumbs extends React.Component<BreadcrumbsProps> {
                     </Button>
                 ))
             }
-        </Grid>
+        </Grid>;
     }
 
     getInactiveItems = () => {
-        return this.props.items.slice(0, -1)
+        return this.props.items.slice(0, -1);
     }
 
     getActiveItem = () => {
-        return this.props.items.slice(-1)
+        return this.props.items.slice(-1);
     }
 
 }
 
-type CssRules = 'inactiveItem'
+type CssRules = 'inactiveItem';
 
 const styles: StyleRulesCallback<CssRules> = theme => {
-    const { unit } = theme.spacing
+    const { unit } = theme.spacing;
     return {
         inactiveItem: {
             opacity: 0.6
         }
-    }
-}
+    };
+};
 
-export default withStyles(styles)(Breadcrumbs)
+export default withStyles(styles)(Breadcrumbs);
 
index 34f9bf3f4659ee0c3ca0067a7f71db3a6029ab68..4ce2f596e5d783f781fce4aab1b70e2e8fe38df0 100644 (file)
@@ -8,8 +8,8 @@ import { PopoverOrigin } from '@material-ui/core/Popover';
 
 
 interface DropdownMenuDataProps {
-    id: string,
-    icon: React.ComponentType,
+    id: string;
+    icon: React.ComponentType;
 }
 
 
@@ -19,12 +19,12 @@ class DropdownMenu extends React.Component<DropdownMenuProps> {
 
     state = {
         anchorEl: undefined
-    }
+    };
 
     transformOrigin: PopoverOrigin = {
         vertical: "top",
         horizontal: "center"
-    }
+    };
 
     render() {
         const { icon: Icon, id, children } = this.props;
@@ -52,17 +52,17 @@ class DropdownMenu extends React.Component<DropdownMenuProps> {
                     {children}
                 </Menu>
             </div>
-        )
+        );
     }
 
     handleClose = () => {
-        this.setState({ anchorEl: undefined })
+        this.setState({ anchorEl: undefined });
     }
 
     handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {
-        this.setState({ anchorEl: event.currentTarget })
+        this.setState({ anchorEl: event.currentTarget });
     }
 }
 
 
-export default DropdownMenu
+export default DropdownMenu;
index 7e0182e2715aee0ada8c038a7696f4b1c055bc06..eb18fd1278463d4f1b73652127e80f7794e71e41 100644 (file)
@@ -8,8 +8,8 @@ import NotificationsIcon from "@material-ui/icons/Notifications";
 import PersonIcon from "@material-ui/icons/Person";
 import HelpIcon from "@material-ui/icons/Help";
 import SearchBar from "./search-bar/search-bar";
-import Breadcrumbs, { Breadcrumb } from "../breadcrumbs/breadcrumbs"
-import DropdownMenu from "./dropdown-menu/dropdown-menu"
+import Breadcrumbs, { Breadcrumb } from "../breadcrumbs/breadcrumbs";
+import DropdownMenu from "./dropdown-menu/dropdown-menu";
 import { User } from "../../models/user";
 
 export interface MainAppBarMenuItem {
@@ -31,9 +31,9 @@ interface MainAppBarDataProps {
 }
 
 export interface MainAppBarActionProps {
-    onSearch: (searchText: string) => void,
-    onBreadcrumbClick: (breadcrumb: Breadcrumb) => void,
-    onMenuItemClick: (menuItem: MainAppBarMenuItem) => void
+    onSearch: (searchText: string) => void;
+    onBreadcrumbClick: (breadcrumb: Breadcrumb) => void;
+    onMenuItemClick: (menuItem: MainAppBarMenuItem) => void;
 }
 
 type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps & WithStyles<CssRules>;
@@ -41,7 +41,7 @@ type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps & WithStyles<
 export class MainAppBar extends React.Component<MainAppBarProps> {
 
     render() {
-        const { classes, searchText, breadcrumbs, searchDebounce } = this.props
+        const { classes, searchText, breadcrumbs, searchDebounce } = this.props;
         return <AppBar className={classes.appBar} position="static">
             <Toolbar>
                 <Grid
@@ -74,11 +74,11 @@ export class MainAppBar extends React.Component<MainAppBarProps> {
                     <Breadcrumbs items={breadcrumbs} onClick={this.props.onBreadcrumbClick} />
                 </Toolbar>
             }
-        </AppBar>
+        </AppBar>;
     }
 
     renderMenuForUser = () => {
-        const { user } = this.props
+        const { user } = this.props;
         return (
             <>
                 <IconButton color="inherit">
@@ -94,19 +94,19 @@ export class MainAppBar extends React.Component<MainAppBarProps> {
                     {this.renderMenuItems(this.props.menuItems.helpMenu)}
                 </DropdownMenu>
             </>
-        )
+        );
     }
 
     renderMenuForAnonymous = () => {
         return this.props.menuItems.anonymousMenu.map((item, index) => (
             <Button key={index} color="inherit" onClick={() => this.props.onMenuItemClick(item)}>{item.label}</Button>
-        ))
+        ));
     }
 
     renderMenuItems = (menuItems: MainAppBarMenuItem[]) => {
         return menuItems.map((item, index) => (
             <MenuItem key={index} onClick={() => this.props.onMenuItemClick(item)}>{item.label}</MenuItem>
-        ))
+        ));
     }
 
     getUserFullname = () => {
@@ -116,12 +116,12 @@ export class MainAppBar extends React.Component<MainAppBarProps> {
 
 }
 
-type CssRules = "appBar"
+type CssRules = "appBar";
 
 const styles: StyleRulesCallback<CssRules> = theme => ({
     appBar: {
         backgroundColor: "#692498"
     }
-})
+});
 
-export default withStyles(styles)(MainAppBar)
\ No newline at end of file
+export default withStyles(styles)(MainAppBar);
\ No newline at end of file
index eaadd1273d04ae478fc9d1d96886f000f83fe22d..2479e4011c3427bd296b5c2c712653fc50de3c62 100644 (file)
@@ -86,10 +86,10 @@ describe("<SearchBar />", () => {
             jest.advanceTimersByTime(500);
             searchBar.find("input").simulate("change", { target: { value: "intermediate value" } });
             jest.advanceTimersByTime(1000);
-            expect(onSearch).toBeCalledWith("intermediate value")
+            expect(onSearch).toBeCalledWith("intermediate value");
             searchBar.find("input").simulate("change", { target: { value: "latest value" } });
             jest.advanceTimersByTime(1000);
-            expect(onSearch).toBeCalledWith("latest value")
+            expect(onSearch).toBeCalledWith("latest value");
             expect(onSearch).toHaveBeenCalledTimes(2);
             
         });
index 944eb426dcaa0d12b889f9ef3fb49235b6951393..f9e93d679c2973bf575b8e65173b028b384dbc9e 100644 (file)
@@ -15,7 +15,7 @@ interface SearchBarActionProps {
     debounce?: number;
 }
 
-type SearchBarProps = SearchBarDataProps & SearchBarActionProps & WithStyles<CssRules>
+type SearchBarProps = SearchBarDataProps & SearchBarActionProps & WithStyles<CssRules>;
 
 interface SearchBarState {
     value: string;
@@ -27,12 +27,12 @@ class SearchBar extends React.Component<SearchBarProps> {
 
     state: SearchBarState = {
         value: ""
-    }
+    };
 
     timeout: NodeJS.Timer;
 
     render() {
-        const { classes } = this.props
+        const { classes } = this.props;
         return <Paper className={classes.container}>
             <form onSubmit={this.handleSubmit}>
                 <input
@@ -45,7 +45,7 @@ class SearchBar extends React.Component<SearchBarProps> {
                     <SearchIcon />
                 </IconButton>
             </form>
-        </Paper>
+        </Paper>;
     }
 
     componentDidMount() {
@@ -80,10 +80,10 @@ class SearchBar extends React.Component<SearchBarProps> {
 
 }
 
-type CssRules = 'container' | 'input' | 'button'
+type CssRules = 'container' | 'input' | 'button';
 
 const styles: StyleRulesCallback<CssRules> = theme => {
-    const { unit } = theme.spacing
+    const { unit } = theme.spacing;
     return {
         container: {
             position: 'relative',
@@ -104,7 +104,7 @@ const styles: StyleRulesCallback<CssRules> = theme => {
             width: unit * 3,
             height: unit * 3
         }
-    }
-}
+    };
+};
 
-export default withStyles(styles)(SearchBar)
\ No newline at end of file
+export default withStyles(styles)(SearchBar);
\ No newline at end of file
index ec16a677f45a83926f7ec79d15c17913ba10d10a..88cd0f7c2cfed57fb2a6669dbd57fd1e251396e9 100644 (file)
@@ -54,7 +54,7 @@ class ProjectList extends React.Component<ProjectListProps & WithStyles<CssRules
                     </TableRow>
                 </TableBody>
             </Table>
-        </Paper>
+        </Paper>;
     }
 }
 
index 5243b5e7ee71507143fb07ebe1faf5ac49f4f4f7..43ad312a940edb632ebcfa4e8eeacc28ac28a242 100644 (file)
@@ -65,4 +65,4 @@ class ProjectTree<T> extends React.Component<ProjectTreeProps & WithStyles<CssRu
     }
 }
 
-export default withStyles(styles)(ProjectTree)
+export default withStyles(styles)(ProjectTree);
index d8397d6673a7a9f2c30a95ee7e7f1c090f1a24d1..fb0df58e5d0a957955871db7c8a5f178c0e7f2c9 100644 (file)
@@ -45,7 +45,7 @@ interface TreeProps<T> {
 
 class Tree<T> extends React.Component<TreeProps<T> & WithStyles<CssRules>, {}> {
     renderArrow (items: boolean, arrowClass: string, open: boolean){
-        return <i className={`${arrowClass} ${open ? "fas fa-caret-down" : `fas fa-caret-down ${this.props.classes.arrowRotate}`}`} />
+        return <i className={`${arrowClass} ${open ? "fas fa-caret-down" : `fas fa-caret-down ${this.props.classes.arrowRotate}`}`} />;
     }
     render(): ReactElement<any> {
         const level = this.props.level ? this.props.level : 0;
@@ -67,9 +67,9 @@ class Tree<T> extends React.Component<TreeProps<T> & WithStyles<CssRules>, {}> {
                         level={level + 1}/>
                 </Collapse>}
              </div>)}
-        </List>
+        </List>;
     }
 }
 
 const StyledTree = withStyles(styles)(Tree);
-export default StyledTree
+export default StyledTree;
index da593c2dfb7a44fad7d88b29ef8ebff70febffc7..4e5013807fd7a0ce8e3a41dac2dc52f79dcf7d15 100644 (file)
@@ -70,8 +70,8 @@ export default class AuthService {
             .get<UserDetailsResponse>('/users/current')
             .then(resp => {
                 dispatch(actions.USER_DETAILS_SUCCESS(resp.data));
-            })
+            });
             // .catch(err => {
             // });
-    };
+    }
 }
index 9350dabdc4894f7ef4ebecb3105da204a0a98f14..939799d2dd62c80b37b9dfd1c81743043c894125 100644 (file)
@@ -53,5 +53,5 @@ export default class ProjectService {
             dispatch(actions.PROJECTS_SUCCESS({projects, parentItemId: parentUuid}));
             return projects;
         });
-    };
+    }
 }
index 57a17ae53cfbb45f9c69529ad34d866771b0f215..3fd7044205854574f125202050f009ebf45189c5 100644 (file)
@@ -11,7 +11,7 @@ import { UserDetailsResponse } from "../../services/auth-service/auth-service";
 export interface AuthState {
     user?: User;
     apiToken?: string;
-};
+}
 
 const authReducer = (state: AuthState = {}, action: AuthAction) => {
     return actions.match(action, {
index d541156e2d3613f6ddd4bd920fb659528c6e1a2b..499d89e82fd84dbfd04ef49dbb373d32b4fd1ac2 100644 (file)
@@ -15,9 +15,9 @@ const composeEnhancers =
     compose;
 
 export interface RootState {
-    auth: AuthState,
-    projects: ProjectState,
-    router: RouterState
+    auth: AuthState;
+    projects: ProjectState;
+    router: RouterState;
 }
 
 const rootReducer = combineReducers({
index 3d0a7ad310b0c135b08a2eade23690aa0627c3ae..ef8e6bd428538080eb25718043decbc890c5db14 100644 (file)
@@ -25,7 +25,7 @@ import { RootState } from "../../store/store";
 import MainAppBar, { MainAppBarActionProps, MainAppBarMenuItems, MainAppBarMenuItem } from '../../components/main-app-bar/main-app-bar';
 import { Breadcrumb } from '../../components/breadcrumbs/breadcrumbs';
 import { push } from 'react-router-redux';
-import projectActions from "../../store/project/project-action"
+import projectActions from "../../store/project/project-action";
 import ProjectTree from '../../components/project-tree/project-tree';
 import { TreeItem } from "../../components/tree/tree";
 import { Project } from "../../models/project";
@@ -76,11 +76,11 @@ interface WorkbenchActionProps {
 type WorkbenchProps = WorkbenchDataProps & WorkbenchActionProps & DispatchProp & WithStyles<CssRules>;
 
 interface NavBreadcrumb extends Breadcrumb {
-    path: string
+    path: string;
 }
 
 interface NavMenuItem extends MainAppBarMenuItem {
-    action: () => void
+    action: () => void;
 }
 
 interface WorkbenchState {
@@ -131,7 +131,7 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
                 }
             ]
         }
-    }
+    };
 
 
     mainAppBarActions: MainAppBarActionProps = {
@@ -141,13 +141,13 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
             this.props.dispatch(push(`/search?q=${searchText}`));
         },
         onMenuItemClick: (menuItem: NavMenuItem) => menuItem.action()
-    }
+    };
 
     toggleProjectTreeItem = (itemId: string) => {
         this.props.dispatch<any>(projectService.getProjectList(itemId)).then(() => {
             this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(itemId));
         });
-    };
+    }
 
     render() {
         const { classes, user } = this.props;
index 1b26ab5f0f629330f31409d8b463422f1ee668d1..4845e4d2c8ad4a60d59e7dc53d785a3227b171f0 100644 (file)
@@ -11,7 +11,8 @@
     "jsx-no-lambda": false,
     "no-debugger": false,
     "no-console": false,
-    "no-shadowed-variable": false
+    "no-shadowed-variable": false,
+    "semicolon": true
   },
   "linterOptions": {
     "exclude": [