Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend: enable eslint no-undef and manual fix #1027

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontends/web/.eslintrc.js
Expand Up @@ -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",

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/anchor/anchor.tsx
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { h, RenderableProps } from 'preact';
import { h, JSX, RenderableProps } from 'preact';
thisconnect marked this conversation as resolved.
Show resolved Hide resolved
import { apiPost } from '../../utils/request';
import * as style from './anchor.css';

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/appupgraderequired.tsx
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/banner/banner.tsx
Expand Up @@ -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';
Expand Down
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/container/container.tsx
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/forms/input.tsx
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/icon/icon.tsx
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/layout/header.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/mobiledatawarning.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/rates/rates.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/sidebar/sidebar.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
@@ -1,4 +1,4 @@
import { h } from 'preact';
import { h, JSX } from 'preact';
import * as style from './icons.css';

export const ArrowIn = (): JSX.Element => (
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/update/update.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/connected.tsx
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/decorators/load.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/decorators/share.tsx
Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion frontends/web/src/decorators/subscribe.tsx
Expand Up @@ -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';
Expand Down Expand Up @@ -126,6 +126,7 @@ export function subscribe<LoadedProps extends ObjectButNotFunction, ProvidedProp
private readonly component = subscribeWithoutLoading ? WrappedComponent : load(endpointsObjectOrFunction, renderOnlyOnceLoaded)(WrappedComponent);

public render(props: RenderableProps<ProvidedProps & Partial<LoadedProps>>, state: LoadedProps): JSX.Element {
/* eslint no-undef: "off" */
return <this.component {...state} {...props} />;
}
};
Expand Down
2 changes: 2 additions & 0 deletions frontends/web/src/i18n/i18n.js
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/routes/account/add/addaccount.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/routes/exchanges/exchanges.tsx
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/routes/settings/components/fiat/fiat.tsx
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { h, RenderableProps } from 'preact';
import { h, JSX, RenderableProps } from 'preact';
import {
currencies,
Fiat,
Expand Down
1 change: 1 addition & 0 deletions frontends/web/src/utils/env.js
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

/* eslint no-undef: "off" */
export const debug = process.env.NODE_ENV === 'development';
thisconnect marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand Down