mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Applied no-underscore-dangle linting rule
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
|
||||
"import/prefer-default-export": 0,
|
||||
"global-require": 0,
|
||||
|
||||
|
||||
"import/no-extraneous-dependencies": 0,
|
||||
@@ -27,8 +28,6 @@
|
||||
"react/forbid-prop-types": 0,
|
||||
"no-mixed-operators": 0,
|
||||
"no-restricted-properties": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"class-methods-use-this": 0,
|
||||
"global-require": 0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,29 +237,24 @@ class DebugToolbar extends React.Component {
|
||||
const ns = this.props.nodes;
|
||||
const nodeNames = ns.keySeq().toJS();
|
||||
this.asyncDispatch(receiveNodesDelta({
|
||||
add: this._addNodes(7),
|
||||
add: this.createRandomNodes(7),
|
||||
update: sampleArray(nodeNames).map(n => ({
|
||||
id: n,
|
||||
adjacency: sampleArray(nodeNames),
|
||||
}), nodeNames.length),
|
||||
remove: this._removeNode(),
|
||||
remove: this.randomExistingNode(),
|
||||
}));
|
||||
}
|
||||
|
||||
_addNodes(n, prefix = 'zing') {
|
||||
createRandomNodes(n, prefix = 'zing') {
|
||||
const ns = this.props.nodes;
|
||||
const nodeNames = ns.keySeq().toJS();
|
||||
const newNodeNames = range(ns.size, ns.size + n).map(i => (
|
||||
// `${randomLetter()}${randomLetter()}-zing`
|
||||
`${prefix}${i}`
|
||||
));
|
||||
<<<<<<< f5ae864fa293b70db13c64d519ec9f261bad4ddd
|
||||
const allNodes = nodeNames.concat(newNodeNames);
|
||||
return newNodeNames.map((name) => deltaAdd(
|
||||
=======
|
||||
const allNodes = _(nodeNames).concat(newNodeNames).value();
|
||||
return newNodeNames.map(name => deltaAdd(
|
||||
>>>>>>> Applied arrow-parens linting rule
|
||||
name,
|
||||
sampleArray(allNodes),
|
||||
sample(SHAPES),
|
||||
@@ -272,13 +267,13 @@ class DebugToolbar extends React.Component {
|
||||
addNodes(n, prefix = 'zing') {
|
||||
setTimeout(() => {
|
||||
this.asyncDispatch(receiveNodesDelta({
|
||||
add: this._addNodes(n, prefix)
|
||||
add: this.createRandomNodes(n, prefix)
|
||||
}));
|
||||
log('added nodes', n);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
_removeNode() {
|
||||
randomExistingNode() {
|
||||
const ns = this.props.nodes;
|
||||
const nodeNames = ns.keySeq().toJS();
|
||||
return [nodeNames[random(nodeNames.length - 1)]];
|
||||
@@ -286,7 +281,7 @@ class DebugToolbar extends React.Component {
|
||||
|
||||
removeNode() {
|
||||
this.asyncDispatch(receiveNodesDelta({
|
||||
remove: this._removeNode()
|
||||
remove: this.randomExistingNode()
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ class Terminal extends React.Component {
|
||||
}
|
||||
this.socket = null;
|
||||
const wereConnected = this.state.connected;
|
||||
if (this._isMounted) {
|
||||
if (this.isMounted) {
|
||||
// Calling setState on an unmounted component will throw a warning.
|
||||
// `connected` will get set to false by `componentWillUnmount`.
|
||||
this.setState({connected: false});
|
||||
@@ -176,7 +176,7 @@ class Terminal extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this._isMounted = true;
|
||||
this.isMounted = true;
|
||||
if (this.props.connect) {
|
||||
this.mountTerminal();
|
||||
}
|
||||
@@ -217,7 +217,7 @@ class Terminal extends React.Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this._isMounted = false;
|
||||
this.isMounted = false;
|
||||
this.setState({connected: false});
|
||||
log('cwu terminal');
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import debug from 'debug';
|
||||
import { identity } from 'lodash';
|
||||
import { createSelector, createSelectorCreator, defaultMemoize } from 'reselect';
|
||||
import { Map as makeMap, is, Set } from 'immutable';
|
||||
|
||||
@@ -44,9 +45,8 @@ function mergeDeepKeyIntersection(mapA, mapB) {
|
||||
// "their results", so use the result of the wrapped selector as the argument to another selector
|
||||
// here to memoize it and get what we want.
|
||||
//
|
||||
const _createDeepEqualSelector = createSelectorCreator(defaultMemoize, is);
|
||||
const _identity = v => v;
|
||||
const returnPreviousRefIfEqual = selector => _createDeepEqualSelector(selector, _identity);
|
||||
const createDeepEqualSelector = createSelectorCreator(defaultMemoize, is);
|
||||
const returnPreviousRefIfEqual = selector => createDeepEqualSelector(selector, identity);
|
||||
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user