From 079418d0da9e36b791968a5c137e826f9e5d815b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 5 Feb 2019 16:41:00 +0100 Subject: [PATCH] setup without tslint --- .eslintrc | 16 +++--- package-lock.json | 114 +++++++++--------------------------------- package.json | 5 +- src/Routes.tsx | 2 +- src/pages/About.tsx | 2 +- src/pages/Details.tsx | 3 +- src/pages/Search.tsx | 8 +-- src/serviceWorker.ts | 2 +- tslint.json | 1 - 9 files changed, 38 insertions(+), 115 deletions(-) diff --git a/.eslintrc b/.eslintrc index 36962a8..afdc6a4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,22 +1,22 @@ { "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "tsconfig.json" + "project": "./tsconfig.json" }, "extends": [ "oceanprotocol", "oceanprotocol/react", "plugin:prettier/recommended", "prettier/react", - "prettier/standard" + "prettier/standard", + "plugin:@typescript-eslint/recommended" ], - "plugins": ["@typescript-eslint/tslint", "prettier"], + "plugins": ["@typescript-eslint", "prettier"], "rules": { - "@typescript-eslint/tslint/config": [ - "warn", - { - "lintFile": "./tslint.json" - } + "@typescript-eslint/explicit-function-return-type": 0, + "@typescript-eslint/member-delimiter-style": [ + "error", + { "multiline": { "delimiter": "none" } } ] } } diff --git a/package-lock.json b/package-lock.json index e9b1b70..1adfb26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1289,13 +1289,26 @@ "@types/underscore": "*" } }, - "@typescript-eslint/eslint-plugin-tslint": { + "@typescript-eslint/eslint-plugin": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-1.2.0.tgz", - "integrity": "sha512-bu1V5uNXKrUfvLqP5taMrjThvKn8zbi6vHjE3cIQh2rU2zNUzFKtn2GpS+qPcRGHJIRjMXhh1sEsdx/f1oQKCQ==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.2.0.tgz", + "integrity": "sha512-em3q8Gg3euesNohOwaz+SqrQM2Jn1ZWELMM+vgKi4dEk5fC+eVoi05yfubgAi2qPE5ifG4F0SOXM1XTamB0Aig==", "dev": true, "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": { @@ -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": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -23511,93 +23530,6 @@ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", "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": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", diff --git a/package.json b/package.json index 53ffb22..dee4a2c 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@types/react-dom": "16.0.11", "@types/react-router-dom": "^4.3.1", "@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", "eslint-config-oceanprotocol": "^1.3.0", "eslint-config-prettier": "^3.3.0", @@ -43,9 +43,6 @@ "stylelint-config-bigchaindb": "^1.2.1", "stylelint-config-css-modules": "^1.3.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" }, "eslintConfig": { diff --git a/src/Routes.tsx b/src/Routes.tsx index 7a9e2f2..9419947 100644 --- a/src/Routes.tsx +++ b/src/Routes.tsx @@ -11,7 +11,7 @@ import Search from './pages/Search' const Routes = () => ( - + diff --git a/src/pages/About.tsx b/src/pages/About.tsx index 06d7f8e..69e53b5 100644 --- a/src/pages/About.tsx +++ b/src/pages/About.tsx @@ -7,7 +7,7 @@ class About extends Component { return (
- + diff --git a/src/pages/Details.tsx b/src/pages/Details.tsx index e782a24..8fc3ec7 100644 --- a/src/pages/Details.tsx +++ b/src/pages/Details.tsx @@ -1,5 +1,4 @@ import { Logger } from '@oceanprotocol/squid' -import queryString from 'query-string' import React, { Component } from 'react' import { User } from '../context/User' @@ -66,7 +65,7 @@ class Details extends Component { return ( <>
{JSON.stringify(this.state.metadata)}
- diff --git a/src/pages/Search.tsx b/src/pages/Search.tsx index 8496c27..673a006 100644 --- a/src/pages/Search.tsx +++ b/src/pages/Search.tsx @@ -47,17 +47,13 @@ class Search extends Component { private renderAssetBox = (asset: any) => { const { metadata } = asset.findServiceByType('Metadata') return ( -
+
{asset.id}
{metadata.base.name}
{metadata.base.description}
-
+ ) } - - private openDetails = (assetId: string) => { - this.props.history.push(`/asset/${assetId}`) - } } export default Search diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts index 1b0222a..eb58197 100644 --- a/src/serviceWorker.ts +++ b/src/serviceWorker.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* eslint-disable */ // This optional code is used to register a service worker. // register() is not called by default. diff --git a/tslint.json b/tslint.json index 8f2699a..c5e2c42 100644 --- a/tslint.json +++ b/tslint.json @@ -1,6 +1,5 @@ { "defaultSeverity": "error", - "extends": ["tslint:recommended", "tslint-config-prettier", "tslint-react"], "jsRules": {}, "rules": { "object-literal-sort-keys": false,