提交 8f2370c0 authored 作者: vipcxj's avatar vipcxj

修复eslint检测出的问题

上级 64aafaad
......@@ -2,6 +2,7 @@
<dictionary name="yaohx_169">
<words>
<w>anticon</w>
<w>arcfour</w>
<w>dropdown</w>
<w>infos</w>
<w>lodash</w>
......
......@@ -53,10 +53,6 @@ const makeProps = (meta) => {
return props;
};
const getColumn = (columns, name) => {
return (columns || []).find(column => name === column.dataIndex);
};
const getColumnIdx = (columns, name) => {
return (columns || []).findIndex(column => name === column.dataIndex);
};
......
import React, {Component} from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { DatePicker, Button } from 'antd';
import moment from 'moment';
......
......@@ -18,7 +18,7 @@ class HeaderPane extends React.Component {
dispatch({ type: 'main/fetchDomains' });
}
render() {
const { dispatch, user, domain, domainList, routes, params, menus } = this.props;
const { dispatch, user, domain, domainList, routes, params } = this.props;
const userTitle = (
<span>
<Icon type="user" />
......
......@@ -22,6 +22,9 @@ class Main extends React.Component {
mode: 'inline',
};
}
componentDidMount() {
this.props.dispatch({ type: 'main/fetchModules' });
}
onClick({ keyPath }) {
const paths = keyPath.reverse().join('/');
this.props.dispatch(routerRedux.push(fullPath(`/main/${paths}`)));
......@@ -32,12 +35,6 @@ class Main extends React.Component {
mode: collapsed ? 'vertical' : 'inline',
});
}
componentDidMount() {
this.props.dispatch({ type: 'main/fetchModules' });
}
render() {
const children = this.props.children;
const { menus } = this.props.main;
......
......@@ -30,7 +30,7 @@ export function addEvent(object, type, handler, remove) {
}
if (!exists) object[xc].push(handler);
}
object[`on${type}`] = function () {
object[`on${type}`] = function cb() {
const l = object[xc].length;
for (let i = 0; i < l; i++) {
object[xc][i].apply(object, arguments);
......
const route = (routes) => {
const Wrapper = ({ children }) => {
return children;
};
......
/* eslint-disable no-unused-vars,camelcase */
// prng4.js - uses Arcfour as a PRNG
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = new Array();
this.S = [];
}
// Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) {
var i, j, t;
for(i = 0; i < 256; ++i)
this.S[i] = i;
let i;
let j;
let t;
for (i = 0; i < 256; ++i) { this.S[i] = i; }
j = 0;
for(i = 0; i < 256; ++i) {
for (i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
......@@ -23,10 +25,9 @@ function ARC4init(key) {
}
function ARC4next() {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
const t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
......@@ -42,4 +43,4 @@ function prng_newstate() {
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
var rng_psize = 256;
const rng_psize = 256;
/* eslint-disable no-undef */
/**
* Created by yaohx_169 on 2017/6/29.
*/
import React from 'react';
import { mount } from 'enzyme';
import chai from 'chai';
chai.should();
describe('ioc', () => {
describe('stateful', () => {
console.log('111');
});
});
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论