1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

setup without tslint

This commit is contained in:
Matthias Kretschmann 2019-02-05 16:41:00 +01:00
parent 868788e614
commit 079418d0da
Signed by: m
GPG Key ID: 606EEEF3C479A91F
9 changed files with 38 additions and 115 deletions

View File

@ -1,22 +1,22 @@
{ {
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"project": "tsconfig.json" "project": "./tsconfig.json"
}, },
"extends": [ "extends": [
"oceanprotocol", "oceanprotocol",
"oceanprotocol/react", "oceanprotocol/react",
"plugin:prettier/recommended", "plugin:prettier/recommended",
"prettier/react", "prettier/react",
"prettier/standard" "prettier/standard",
"plugin:@typescript-eslint/recommended"
], ],
"plugins": ["@typescript-eslint/tslint", "prettier"], "plugins": ["@typescript-eslint", "prettier"],
"rules": { "rules": {
"@typescript-eslint/tslint/config": [ "@typescript-eslint/explicit-function-return-type": 0,
"warn", "@typescript-eslint/member-delimiter-style": [
{ "error",
"lintFile": "./tslint.json" { "multiline": { "delimiter": "none" } }
}
] ]
} }
} }

114
package-lock.json generated
View File

@ -1289,13 +1289,26 @@
"@types/underscore": "*" "@types/underscore": "*"
} }
}, },
"@typescript-eslint/eslint-plugin-tslint": { "@typescript-eslint/eslint-plugin": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.2.0.tgz",
"integrity": "sha512-bu1V5uNXKrUfvLqP5taMrjThvKn8zbi6vHjE3cIQh2rU2zNUzFKtn2GpS+qPcRGHJIRjMXhh1sEsdx/f1oQKCQ==", "integrity": "sha512-em3q8Gg3euesNohOwaz+SqrQM2Jn1ZWELMM+vgKi4dEk5fC+eVoi05yfubgAi2qPE5ifG4F0SOXM1XTamB0Aig==",
"dev": true, "dev": true,
"requires": { "requires": {
"lodash.memoize": "^4.1.2" "@typescript-eslint/parser": "1.2.0",
"requireindex": "^1.2.0",
"tsutils": "^3.7.0"
},
"dependencies": {
"tsutils": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.8.0.tgz",
"integrity": "sha512-XQdPhgcoTbCD8baXC38PQ0vpTZ8T3YrE+vR66YIj/xvDt1//8iAhafpIT/4DmvzzC1QFapEImERu48Pa01dIUA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
}
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
@ -20399,6 +20412,12 @@
} }
} }
}, },
"requireindex": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
"integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
"dev": true
},
"requires-port": { "requires-port": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
@ -23511,93 +23530,6 @@
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
"dev": true "dev": true
}, },
"tslint": {
"version": "5.12.1",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.12.1.tgz",
"integrity": "sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==",
"dev": true,
"requires": {
"babel-code-frame": "^6.22.0",
"builtin-modules": "^1.1.1",
"chalk": "^2.3.0",
"commander": "^2.12.1",
"diff": "^3.2.0",
"glob": "^7.1.1",
"js-yaml": "^3.7.0",
"minimatch": "^3.0.4",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tsutils": "^2.27.2"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"commander": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
"integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
"dev": true
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"tslint-config-prettier": {
"version": "1.18.0",
"resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz",
"integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==",
"dev": true
},
"tslint-react": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-3.6.0.tgz",
"integrity": "sha512-AIv1QcsSnj7e9pFir6cJ6vIncTqxfqeFF3Lzh8SuuBljueYzEAtByuB6zMaD27BL0xhMEqsZ9s5eHuCONydjBw==",
"dev": true,
"requires": {
"tsutils": "^2.13.1"
}
},
"tsutils": {
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
"integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
},
"tty-browserify": { "tty-browserify": {
"version": "0.0.0", "version": "0.0.0",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",

View File

@ -30,7 +30,7 @@
"@types/react-dom": "16.0.11", "@types/react-dom": "16.0.11",
"@types/react-router-dom": "^4.3.1", "@types/react-router-dom": "^4.3.1",
"@types/web3": "^1.0.18", "@types/web3": "^1.0.18",
"@typescript-eslint/eslint-plugin-tslint": "^1.2.0", "@typescript-eslint/eslint-plugin": "^1.2.0",
"@typescript-eslint/parser": "^1.2.0", "@typescript-eslint/parser": "^1.2.0",
"eslint-config-oceanprotocol": "^1.3.0", "eslint-config-oceanprotocol": "^1.3.0",
"eslint-config-prettier": "^3.3.0", "eslint-config-prettier": "^3.3.0",
@ -43,9 +43,6 @@
"stylelint-config-bigchaindb": "^1.2.1", "stylelint-config-bigchaindb": "^1.2.1",
"stylelint-config-css-modules": "^1.3.0", "stylelint-config-css-modules": "^1.3.0",
"stylelint-config-standard": "^18.2.0", "stylelint-config-standard": "^18.2.0",
"tslint": "^5.12.1",
"tslint-config-prettier": "^1.17.0",
"tslint-react": "^3.6.0",
"typescript": "3.2.4" "typescript": "3.2.4"
}, },
"eslintConfig": { "eslintConfig": {

View File

@ -11,7 +11,7 @@ import Search from './pages/Search'
const Routes = () => ( const Routes = () => (
<Router> <Router>
<Switch> <Switch>
<Route exact={true} component={Home} path="/" /> <Route exact component={Home} path="/" />
<Route component={About} path="/about" /> <Route component={About} path="/about" />
<Route component={Publish} path="/publish" /> <Route component={Publish} path="/publish" />
<Route component={Search} path="/search" /> <Route component={Search} path="/search" />

View File

@ -7,7 +7,7 @@ class About extends Component {
return ( return (
<div className={styles.about}> <div className={styles.about}>
<Button>I am a button</Button> <Button>I am a button</Button>
<Button primary={true}>I am a primary button</Button> <Button primary>I am a primary button</Button>
<Button href="https://hello.com"> <Button href="https://hello.com">
I am a link disguised as a button I am a link disguised as a button
</Button> </Button>

View File

@ -1,5 +1,4 @@
import { Logger } from '@oceanprotocol/squid' import { Logger } from '@oceanprotocol/squid'
import queryString from 'query-string'
import React, { Component } from 'react' import React, { Component } from 'react'
import { User } from '../context/User' import { User } from '../context/User'
@ -66,7 +65,7 @@ class Details extends Component<IProps, IState> {
return ( return (
<> <>
<div>{JSON.stringify(this.state.metadata)}</div> <div>{JSON.stringify(this.state.metadata)}</div>
<button onClick={this.purchaseAsset.bind(this, ddo)}> <button onClick={this.purchaseAsset(ddo)}>
Purchase asset Purchase asset
</button> </button>
</> </>

View File

@ -47,17 +47,13 @@ class Search extends Component<IProps, IState> {
private renderAssetBox = (asset: any) => { private renderAssetBox = (asset: any) => {
const { metadata } = asset.findServiceByType('Metadata') const { metadata } = asset.findServiceByType('Metadata')
return ( return (
<div key={asset.id} onClick={this.openDetails.bind(this, asset.id)}> <Link key={asset.id} to={`/asset/${asset.id}`}>
<div>{asset.id}</div> <div>{asset.id}</div>
<div>{metadata.base.name}</div> <div>{metadata.base.name}</div>
<div>{metadata.base.description}</div> <div>{metadata.base.description}</div>
</div> </Link>
) )
} }
private openDetails = (assetId: string) => {
this.props.history.push(`/asset/${assetId}`)
}
} }
export default Search export default Search

View File

@ -1,4 +1,4 @@
/* tslint:disable */ /* eslint-disable */
// This optional code is used to register a service worker. // This optional code is used to register a service worker.
// register() is not called by default. // register() is not called by default.

View File

@ -1,6 +1,5 @@
{ {
"defaultSeverity": "error", "defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-config-prettier", "tslint-react"],
"jsRules": {}, "jsRules": {},
"rules": { "rules": {
"object-literal-sort-keys": false, "object-literal-sort-keys": false,