From bcede18c5060b8fedb396718b66b87a4621b6d18 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 5 Feb 2019 17:05:28 +0100 Subject: [PATCH] kick out tslint --- .eslintrc | 3 +++ src/App.tsx | 29 +++++++++++++---------------- src/components/atoms/Button.tsx | 4 ++-- src/pages/Details.tsx | 6 +++--- src/pages/Home.tsx | 6 +++--- src/pages/Publish.tsx | 5 +++-- src/pages/Search.tsx | 6 +++--- tslint.json | 9 --------- 8 files changed, 30 insertions(+), 38 deletions(-) delete mode 100644 tslint.json diff --git a/.eslintrc b/.eslintrc index afdc6a4..d139063 100644 --- a/.eslintrc +++ b/.eslintrc @@ -18,5 +18,8 @@ "error", { "multiline": { "delimiter": "none" } } ] + }, + "env": { + "jest": true } } diff --git a/src/App.tsx b/src/App.tsx index 63b4256..ad9f367 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,29 +8,26 @@ import './styles/global.scss' import { nodeHost, nodePort, nodeScheme } from './config' -interface IState { +interface AppState { isLogged: boolean web3: any ocean: {} startLogin: () => void } -class App extends Component<{}, IState> { - public startLogin: () => void - constructor(props: {}) { - super(props) - this.startLogin = (event?) => { - if (event) { - event.preventDefault() - } - this.startLoginProcess() - } - this.state = { - isLogged: false, - web3: {}, - ocean: {}, - startLogin: this.startLogin +class App extends Component<{}, AppState> { + public startLogin = (event?: any) => { + if (event) { + event.preventDefault() } + this.startLoginProcess() + } + + public state = { + isLogged: false, + web3: {}, + ocean: {}, + startLogin: this.startLogin } public async componentDidMount() { diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 7e94297..4565604 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -1,14 +1,14 @@ import React, { PureComponent } from 'react' import styles from './Button.module.scss' -interface IButtonProps { +interface ButtonProps { children: string primary?: boolean link?: boolean href?: string } -export default class Button extends PureComponent { +export default class Button extends PureComponent { public render() { let classes const { primary, link, href, children } = this.props diff --git a/src/pages/Details.tsx b/src/pages/Details.tsx index 8fc3ec7..f02e65f 100644 --- a/src/pages/Details.tsx +++ b/src/pages/Details.tsx @@ -2,17 +2,17 @@ import { Logger } from '@oceanprotocol/squid' import React, { Component } from 'react' import { User } from '../context/User' -interface IState { +interface DetailsState { ddo: any metadata: any } -interface IProps { +interface DetailsProps { location: any match: any } -class Details extends Component { +class Details extends Component { public state = { ddo: null, metadata: null } public async componentDidMount() { diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index f2351fd..579f59f 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -2,15 +2,15 @@ import React, { ChangeEvent, Component, FormEvent } from 'react' import Button from '../components/atoms/Button' import styles from './Home.module.scss' -interface IState { +interface HomeState { search?: string } -interface IProps { +interface HomeProps { history: any } -class Home extends Component { +class Home extends Component { public state = { search: '' } public render() { diff --git a/src/pages/Publish.tsx b/src/pages/Publish.tsx index 52ad96e..10eb097 100644 --- a/src/pages/Publish.tsx +++ b/src/pages/Publish.tsx @@ -5,7 +5,7 @@ import AssetModel from '../models/AssetModel' type AssetType = 'dataset' | 'algorithm' | 'container' | 'workflow' | 'other' -interface IState { +interface PublishState { name?: string dateCreated?: Date description?: string @@ -19,7 +19,7 @@ interface IState { tags?: string[] } -class Publish extends Component<{}, IState> { +class Publish extends Component<{}, PublishState> { public state = { name: '', dateCreated: new Date(), @@ -281,6 +281,7 @@ class Publish extends Component<{}, IState> { AssetModel.additionalInformation ) } + const ddo = await this.context.ocean.registerAsset(newAsset, account[0]) } } diff --git a/src/pages/Search.tsx b/src/pages/Search.tsx index 673a006..f8ef3d8 100644 --- a/src/pages/Search.tsx +++ b/src/pages/Search.tsx @@ -3,16 +3,16 @@ import React, { Component } from 'react' import { Link } from 'react-router-dom' import { provideOcean } from '../ocean' -interface IState { +interface SearchState { results: any[] } -interface IProps { +interface SearchProps { location: any history: any } -class Search extends Component { +class Search extends Component { public state = { results: [] } public async componentDidMount() { diff --git a/tslint.json b/tslint.json deleted file mode 100644 index c5e2c42..0000000 --- a/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "defaultSeverity": "error", - "jsRules": {}, - "rules": { - "object-literal-sort-keys": false, - "semicolon": [true, "never"] - }, - "rulesDirectory": [] -}