From 3778f57baefc43e85ff6c5957ece7d78c83128d7 Mon Sep 17 00:00:00 2001 From: thisconnect Date: Sat, 3 Oct 2020 19:41:10 +0200 Subject: [PATCH] frontend: enable eslint no-undef and manual fix --- frontends/web/.eslintrc.js | 2 +- frontends/web/src/components/anchor/anchor.tsx | 2 +- frontends/web/src/components/appupgraderequired.tsx | 2 +- frontends/web/src/components/banner/banner.tsx | 2 +- .../web/src/components/centeredcontent/centeredcontent.tsx | 2 +- frontends/web/src/components/container/container.tsx | 2 +- frontends/web/src/components/forms/input.tsx | 2 +- frontends/web/src/components/icon/icon.tsx | 2 +- frontends/web/src/components/layout/header.tsx | 2 +- frontends/web/src/components/mobiledatawarning.tsx | 2 +- frontends/web/src/components/rates/rates.tsx | 2 +- frontends/web/src/components/sidebar/sidebar.tsx | 2 +- frontends/web/src/components/steps/steps.tsx | 2 +- frontends/web/src/components/transactions/components/icons.tsx | 2 +- frontends/web/src/components/update/update.tsx | 2 +- frontends/web/src/connected.tsx | 2 +- frontends/web/src/decorators/load.tsx | 2 +- frontends/web/src/decorators/share.tsx | 2 +- frontends/web/src/decorators/subscribe.tsx | 3 ++- frontends/web/src/i18n/i18n.js | 2 ++ frontends/web/src/routes/account/add/addaccount.tsx | 2 +- frontends/web/src/routes/exchanges/exchanges.tsx | 2 +- frontends/web/src/routes/settings/components/fiat/fiat.tsx | 2 +- frontends/web/src/utils/env.js | 1 + 24 files changed, 26 insertions(+), 22 deletions(-) diff --git a/frontends/web/.eslintrc.js b/frontends/web/.eslintrc.js index e7c6f1de84..11a26c2054 100644 --- a/frontends/web/.eslintrc.js +++ b/frontends/web/.eslintrc.js @@ -159,9 +159,9 @@ module.exports = { "react/jsx-key": "off", "object-curly-spacing": ["warn", "always"], "@typescript-eslint/no-empty-interface": "off", + "no-undef": "error", // TODO: enable again - "no-undef": "off", "react/no-unknown-property": "off", "react/no-children-prop": "off", diff --git a/frontends/web/src/components/anchor/anchor.tsx b/frontends/web/src/components/anchor/anchor.tsx index 2b1b52576d..3d2eb2b41f 100644 --- a/frontends/web/src/components/anchor/anchor.tsx +++ b/frontends/web/src/components/anchor/anchor.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { apiPost } from '../../utils/request'; import * as style from './anchor.css'; diff --git a/frontends/web/src/components/appupgraderequired.tsx b/frontends/web/src/components/appupgraderequired.tsx index ec78b7a017..99f74f057e 100644 --- a/frontends/web/src/components/appupgraderequired.tsx +++ b/frontends/web/src/components/appupgraderequired.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { translate, TranslateProps } from '../decorators/translate'; import A from './anchor/anchor'; diff --git a/frontends/web/src/components/banner/banner.tsx b/frontends/web/src/components/banner/banner.tsx index 8c6d9ae133..f5ff20b4da 100644 --- a/frontends/web/src/components/banner/banner.tsx +++ b/frontends/web/src/components/banner/banner.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { subscribe } from '../../decorators/subscribe'; import { translate, TranslateProps } from '../../decorators/translate'; import A from '../anchor/anchor'; diff --git a/frontends/web/src/components/centeredcontent/centeredcontent.tsx b/frontends/web/src/components/centeredcontent/centeredcontent.tsx index 675a638805..6c33031175 100644 --- a/frontends/web/src/components/centeredcontent/centeredcontent.tsx +++ b/frontends/web/src/components/centeredcontent/centeredcontent.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import * as style from './style.css'; export function CenteredContent({ children }: RenderableProps<{}>): JSX.Element { diff --git a/frontends/web/src/components/container/container.tsx b/frontends/web/src/components/container/container.tsx index 040885d073..02ba2a2b23 100644 --- a/frontends/web/src/components/container/container.tsx +++ b/frontends/web/src/components/container/container.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { cloneElement, h, RenderableProps } from 'preact'; +import { cloneElement, h, JSX, RenderableProps } from 'preact'; import { Router } from 'preact-router'; interface Props { diff --git a/frontends/web/src/components/forms/input.tsx b/frontends/web/src/components/forms/input.tsx index 3a2e94a9f0..66fbecbc6a 100644 --- a/frontends/web/src/components/forms/input.tsx +++ b/frontends/web/src/components/forms/input.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import * as styles from './input.css'; export interface Props { diff --git a/frontends/web/src/components/icon/icon.tsx b/frontends/web/src/components/icon/icon.tsx index 64d3a8b413..78b6273bb1 100644 --- a/frontends/web/src/components/icon/icon.tsx +++ b/frontends/web/src/components/icon/icon.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h } from 'preact'; +import { h, JSX } from 'preact'; import alert from './assets/icons/alert-triangle.svg'; import * as style from './icon.css'; diff --git a/frontends/web/src/components/layout/header.tsx b/frontends/web/src/components/layout/header.tsx index 4c7ed6a653..94b70de773 100644 --- a/frontends/web/src/components/layout/header.tsx +++ b/frontends/web/src/components/layout/header.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Component, h, RenderableProps } from 'preact'; +import { Component, h, JSX, RenderableProps } from 'preact'; import MenuIcon from '../../assets/icons/menu.svg'; import { share } from '../../decorators/share'; import { translate, TranslateProps } from '../../decorators/translate'; diff --git a/frontends/web/src/components/mobiledatawarning.tsx b/frontends/web/src/components/mobiledatawarning.tsx index cfe66e6958..5ee21a3a1c 100644 --- a/frontends/web/src/components/mobiledatawarning.tsx +++ b/frontends/web/src/components/mobiledatawarning.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { subscribe } from '../decorators/subscribe'; import { translate, TranslateProps } from '../decorators/translate'; import Status from './status/status'; diff --git a/frontends/web/src/components/rates/rates.tsx b/frontends/web/src/components/rates/rates.tsx index 14745de682..435516b0db 100644 --- a/frontends/web/src/components/rates/rates.tsx +++ b/frontends/web/src/components/rates/rates.tsx @@ -15,7 +15,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { share } from '../../decorators/share'; import { Store } from '../../decorators/store'; import { setConfig } from '../../utils/config'; diff --git a/frontends/web/src/components/sidebar/sidebar.tsx b/frontends/web/src/components/sidebar/sidebar.tsx index 04483fbb73..d4b32292ee 100644 --- a/frontends/web/src/components/sidebar/sidebar.tsx +++ b/frontends/web/src/components/sidebar/sidebar.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Component, h, RenderableProps } from 'preact'; +import { Component, h, JSX, RenderableProps } from 'preact'; import { Link, Match } from 'preact-router/match'; import coins from '../../assets/icons/coins.svg'; import ejectIcon from '../../assets/icons/eject.svg'; diff --git a/frontends/web/src/components/steps/steps.tsx b/frontends/web/src/components/steps/steps.tsx index 6816c469f3..2ab54cf461 100644 --- a/frontends/web/src/components/steps/steps.tsx +++ b/frontends/web/src/components/steps/steps.tsx @@ -1,4 +1,4 @@ -import { cloneElement, Component, h, RenderableProps } from 'preact'; +import { cloneElement, Component, h, JSX, RenderableProps } from 'preact'; import * as style from './steps.css'; interface State { diff --git a/frontends/web/src/components/transactions/components/icons.tsx b/frontends/web/src/components/transactions/components/icons.tsx index 1a3b1bc878..4fdb8fe356 100644 --- a/frontends/web/src/components/transactions/components/icons.tsx +++ b/frontends/web/src/components/transactions/components/icons.tsx @@ -1,4 +1,4 @@ -import { h } from 'preact'; +import { h, JSX } from 'preact'; import * as style from './icons.css'; export const ArrowIn = (): JSX.Element => ( diff --git a/frontends/web/src/components/update/update.tsx b/frontends/web/src/components/update/update.tsx index c507450ae4..764899d585 100644 --- a/frontends/web/src/components/update/update.tsx +++ b/frontends/web/src/components/update/update.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { load } from '../../decorators/load'; import { translate, TranslateProps } from '../../decorators/translate'; import A from '../anchor/anchor'; diff --git a/frontends/web/src/connected.tsx b/frontends/web/src/connected.tsx index 62233d1f2c..70800e25e3 100644 --- a/frontends/web/src/connected.tsx +++ b/frontends/web/src/connected.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { App } from './app'; import { subscribe } from './decorators/subscribe'; diff --git a/frontends/web/src/decorators/load.tsx b/frontends/web/src/decorators/load.tsx index dfc7e6c497..7107417ab6 100644 --- a/frontends/web/src/decorators/load.tsx +++ b/frontends/web/src/decorators/load.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Component, ComponentFactory, h, RenderableProps } from 'preact'; +import { Component, ComponentFactory, h, JSX, RenderableProps } from 'preact'; import { getDisplayName } from '../utils/component'; import { apiGet } from '../utils/request'; import { KeysOf, ObjectButNotFunction } from '../utils/types'; diff --git a/frontends/web/src/decorators/share.tsx b/frontends/web/src/decorators/share.tsx index 885a178c99..0fc8e748a6 100644 --- a/frontends/web/src/decorators/share.tsx +++ b/frontends/web/src/decorators/share.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Component, ComponentFactory, h, RenderableProps } from 'preact'; +import { Component, ComponentFactory, h, JSX, RenderableProps } from 'preact'; import { getDisplayName } from '../utils/component'; import { ObjectButNotFunction } from '../utils/types'; import { Store } from './store'; diff --git a/frontends/web/src/decorators/subscribe.tsx b/frontends/web/src/decorators/subscribe.tsx index 7ace4962d7..9ec08902cd 100644 --- a/frontends/web/src/decorators/subscribe.tsx +++ b/frontends/web/src/decorators/subscribe.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Component, ComponentFactory, h, RenderableProps } from 'preact'; +import { Component, ComponentFactory, h, JSX, RenderableProps } from 'preact'; import { getDisplayName } from '../utils/component'; import { equal } from '../utils/equal'; import { apiSubscribe, Event } from '../utils/event'; @@ -126,6 +126,7 @@ export function subscribe>, state: LoadedProps): JSX.Element { + /* eslint no-undef: "off" */ return ; } }; diff --git a/frontends/web/src/i18n/i18n.js b/frontends/web/src/i18n/i18n.js index 287122166e..52ad0af302 100644 --- a/frontends/web/src/i18n/i18n.js +++ b/frontends/web/src/i18n/i18n.js @@ -38,7 +38,9 @@ import { setConfig } from '../utils/config'; // if a language is not officially added yet, add it through this env var to make it available // (e.g. "es,fr,sl"). + /* eslint no-undef: "off" */ export const extraLanguages = process.env.PREACT_APP_I18N_ADDLANGUAGES; +/* eslint no-undef: "off" */ export const i18nEditorActive = process.env.PREACT_APP_I18NEDITOR === '1'; const locizeProjectID = 'fe4e5a24-e4a2-4903-96fc-3d62c11fc502'; diff --git a/frontends/web/src/routes/account/add/addaccount.tsx b/frontends/web/src/routes/account/add/addaccount.tsx index d2507100dd..8bca610d20 100644 --- a/frontends/web/src/routes/account/add/addaccount.tsx +++ b/frontends/web/src/routes/account/add/addaccount.tsx @@ -15,7 +15,7 @@ */ import linkState from 'linkstate'; -import { Component, h, RenderableProps } from 'preact'; +import { Component, h, JSX, RenderableProps } from 'preact'; import { route } from 'preact-router'; import { alertUser } from '../../../components/alert/Alert'; import { Button, ButtonLink, Input, Select } from '../../../components/forms'; diff --git a/frontends/web/src/routes/exchanges/exchanges.tsx b/frontends/web/src/routes/exchanges/exchanges.tsx index f39b828cc3..9c3dcb0ab0 100644 --- a/frontends/web/src/routes/exchanges/exchanges.tsx +++ b/frontends/web/src/routes/exchanges/exchanges.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Component, h, RenderableProps } from 'preact'; +import { Component, h, JSX, RenderableProps } from 'preact'; import A from '../../components/anchor/anchor'; import Button from '../../components/forms/button'; import { Entry } from '../../components/guide/entry'; diff --git a/frontends/web/src/routes/settings/components/fiat/fiat.tsx b/frontends/web/src/routes/settings/components/fiat/fiat.tsx index d726474158..c28729c709 100644 --- a/frontends/web/src/routes/settings/components/fiat/fiat.tsx +++ b/frontends/web/src/routes/settings/components/fiat/fiat.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { h, RenderableProps } from 'preact'; +import { h, JSX, RenderableProps } from 'preact'; import { currencies, Fiat, diff --git a/frontends/web/src/utils/env.js b/frontends/web/src/utils/env.js index f64deaf99a..7828301c4b 100644 --- a/frontends/web/src/utils/env.js +++ b/frontends/web/src/utils/env.js @@ -14,6 +14,7 @@ * limitations under the License. */ + /* eslint no-undef: "off" */ export const debug = process.env.NODE_ENV === 'development'; /**