mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#337: fix some linting errors
This commit is contained in:
@ -63,6 +63,7 @@
|
|||||||
"dot-notation": "error",
|
"dot-notation": "error",
|
||||||
"eqeqeq": ["error", "smart"],
|
"eqeqeq": ["error", "smart"],
|
||||||
"no-alert": "error",
|
"no-alert": "error",
|
||||||
|
"no-console": "off",
|
||||||
"no-caller": "error",
|
"no-caller": "error",
|
||||||
"no-case-declarations": "error",
|
"no-case-declarations": "error",
|
||||||
"no-div-regex": "error",
|
"no-div-regex": "error",
|
||||||
@ -134,7 +135,7 @@
|
|||||||
"consistent-this": ["error", "that"],
|
"consistent-this": ["error", "that"],
|
||||||
"camelcase": "warn",
|
"camelcase": "warn",
|
||||||
"eol-last": "warn",
|
"eol-last": "warn",
|
||||||
"id-length": ["error", {"min": 2, "exceptions": ["x", "y", "i", "$"]}],
|
"id-length": ["error", {"min": 2, "exceptions": ["x", "y", "i", "k", "l", "m", "n", "$", "_"]}],
|
||||||
"indent": ["error", 4, {"SwitchCase": 1}],
|
"indent": ["error", 4, {"SwitchCase": 1}],
|
||||||
"jsx-quotes": "error",
|
"jsx-quotes": "error",
|
||||||
"key-spacing": ["error", {"mode": "minimum"}],
|
"key-spacing": ["error", {"mode": "minimum"}],
|
||||||
@ -168,7 +169,7 @@
|
|||||||
"spaced-comment": "warn",
|
"spaced-comment": "warn",
|
||||||
|
|
||||||
// es6
|
// es6
|
||||||
"arrow-body-style": "warn",
|
"arrow-body-style": "off",
|
||||||
"arrow-parens": "error",
|
"arrow-parens": "error",
|
||||||
"arrow-spacing": "error",
|
"arrow-spacing": "error",
|
||||||
"constructor-super": "error",
|
"constructor-super": "error",
|
||||||
|
@ -123,12 +123,12 @@ export class AccountSwitcher extends Component {
|
|||||||
className={styles.addAccount}
|
className={styles.addAccount}
|
||||||
label={
|
label={
|
||||||
<Message {...messages.addAccount}>
|
<Message {...messages.addAccount}>
|
||||||
{(message) =>
|
{(message) => (
|
||||||
<span>
|
<span>
|
||||||
<div className={styles.addIcon} />
|
<div className={styles.addIcon} />
|
||||||
{message}
|
{message}
|
||||||
</span>
|
</span>
|
||||||
}
|
)}
|
||||||
</Message>
|
</Message>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
import { FormattedMessage as Message } from 'react-intl';
|
import { FormattedMessage as Message } from 'react-intl';
|
||||||
|
|
||||||
export default function AuthTitle({title}) {
|
export default function AuthTitle({title}: {title: {id: string}}) {
|
||||||
return (
|
return (
|
||||||
<Message {...title}>
|
<Message {...title}>
|
||||||
{(msg) => <span>{msg}<Helmet title={msg} /></span>}
|
{(msg) => <span>{msg}<Helmet title={msg} /></span>}
|
||||||
|
@ -36,6 +36,7 @@ const contexts = [
|
|||||||
['chooseAccount', 'permissions']
|
['chooseAccount', 'permissions']
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
// test panel uniquenes between contexts
|
// test panel uniquenes between contexts
|
||||||
// TODO: it may be moved to tests in future
|
// TODO: it may be moved to tests in future
|
||||||
|
@ -104,7 +104,9 @@ class Finish extends Component {
|
|||||||
// TODO: было бы ещё неплохо сделать какую-то анимацию, вроде "Скопировано",
|
// TODO: было бы ещё неплохо сделать какую-то анимацию, вроде "Скопировано",
|
||||||
// ибо сейчас после клика как-то неубедительно, скопировалось оно или нет
|
// ибо сейчас после клика как-то неубедительно, скопировалось оно или нет
|
||||||
console.log('Copying text command was ' + (successful ? 'successful' : 'unsuccessful'));
|
console.log('Copying text command was ' + (successful ? 'successful' : 'unsuccessful'));
|
||||||
} catch (err) {}
|
} catch (err) {
|
||||||
|
// not critical
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
setCode = (el) => {
|
setCode = (el) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { FormattedMessage as Message, FormattedRelative as Relative, FormattedHTMLMessage as HTMLMessage } from 'react-intl';
|
import { FormattedMessage as Message, FormattedRelative as Relative } from 'react-intl';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@ import React, { Component, PropTypes } from 'react';
|
|||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import FormModel from './FormModel';
|
import logger from 'services/logger';
|
||||||
|
|
||||||
|
import FormModel from './FormModel';
|
||||||
import styles from './form.scss';
|
import styles from './form.scss';
|
||||||
|
|
||||||
export default class Form extends Component {
|
export default class Form extends Component {
|
||||||
@ -106,7 +107,8 @@ export default class Form extends Component {
|
|||||||
|
|
||||||
Array.from(invalidEls).reduce((errors, el) => {
|
Array.from(invalidEls).reduce((errors, el) => {
|
||||||
if (!el.name) {
|
if (!el.name) {
|
||||||
console.warn('Found an element without name', el);
|
logger.warn('Found an element without name', {el});
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import sinon from 'sinon';
|
||||||
import expect from 'unexpected';
|
import expect from 'unexpected';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
import authFlow from 'services/authFlow';
|
// @flow
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
import { Route, Redirect } from 'react-router-dom';
|
import { Route, Redirect } from 'react-router-dom';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
const PrivateRoute = ({user, component: Component, ...rest}) => (
|
import type {User} from 'components/user';
|
||||||
<Route {...rest} render={(props) => (
|
|
||||||
|
const PrivateRoute = ({user, component: Component, ...rest}: {
|
||||||
|
component: any,
|
||||||
|
user: User
|
||||||
|
}) => (
|
||||||
|
<Route {...rest} render={(props: {location: string}) => (
|
||||||
user.isGuest ? (
|
user.isGuest ? (
|
||||||
<Redirect to={{
|
<Redirect to={{
|
||||||
pathname: '/login',
|
pathname: '/login',
|
||||||
|
@ -108,7 +108,9 @@ export default connect(null, {
|
|||||||
function requestPassword(form) {
|
function requestPassword(form) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
dispatch(createPopup({
|
dispatch(createPopup({
|
||||||
Popup(props) {
|
Popup(props: {
|
||||||
|
onClose: Function
|
||||||
|
}) {
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
form.beginLoading();
|
form.beginLoading();
|
||||||
sendData()
|
sendData()
|
||||||
|
Reference in New Issue
Block a user