Prefer default export to make XO happy (#931)

* Comply with prefer-default-export rule for findBySession function

* Remove XO's prefer-default-export rule

* Comply with prefer-default-export rule for init function

* Comply with prefer-default-export rule for getRootGroups function

* Comply with prefer-default-export rule for INIT constant

* Comply with prefer-default-export rule for isExecutable function

* Fix default export for constants

* Comply with prefer-default-export rule for last function

* Comply with prefer-default-export rule for getColorList function
This commit is contained in:
David Gómez 2016-10-25 08:53:15 -04:00 committed by Leo Lamprecht
parent de5b384ccd
commit 8f28573fc0
16 changed files with 24 additions and 21 deletions

View file

@ -1,7 +1,7 @@
import rpc from '../rpc';
import {INIT} from '../constants';
import INIT from '../constants';
export function init() {
export default function init() {
return dispatch => {
dispatch({
type: INIT,

View file

@ -1,7 +1,7 @@
import rpc from '../rpc';
import getURL from '../utils/url-command';
import {keys} from '../utils/object';
import {findBySession} from '../utils/term-groups';
import findBySession from '../utils/term-groups';
import {
SESSION_ADD,
SESSION_RESIZE,

View file

@ -7,8 +7,8 @@ import {
TERM_GROUP_EXIT_ACTIVE
} from '../constants/term-groups';
import {SESSION_REQUEST} from '../constants/sessions';
import {findBySession} from '../utils/term-groups';
import {getRootGroups} from '../selectors';
import findBySession from '../utils/term-groups';
import getRootGroups from '../selectors';
import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
function requestSplit(direction) {

View file

@ -1,8 +1,8 @@
import * as shellEscape from 'php-escape-shell';
import {last} from '../utils/array';
import {isExecutable} from '../utils/file';
import {getRootGroups} from '../selectors';
import {findBySession} from '../utils/term-groups';
import last from '../utils/array';
import isExecutable from '../utils/file';
import getRootGroups from '../selectors';
import findBySession from '../utils/term-groups';
import notify from '../utils/notify';
import rpc from '../rpc';
import {

View file

@ -4,7 +4,7 @@ import Color from 'color';
import uuid from 'uuid';
import hterm from '../hterm';
import Component from '../component';
import {getColorList} from '../utils/colors';
import getColorList from '../utils/colors';
import notify from '../utils/notify';
export default class Term extends Component {

View file

@ -1 +1,3 @@
export const INIT = 'INIT';
const INIT = 'INIT';
export default INIT;

View file

@ -4,7 +4,7 @@ import {createSelector} from 'reselect';
import Header from '../components/header';
import {closeTab, changeTab, maximize, unmaximize} from '../actions/header';
import {connect} from '../utils/plugins';
import {getRootGroups} from '../selectors';
import getRootGroups from '../selectors';
const isMac = /Mac/.test(navigator.userAgent);

View file

@ -7,7 +7,7 @@ import {
setSessionXtermTitle,
setActiveSession
} from '../actions/sessions';
import {getRootGroups} from '../selectors';
import getRootGroups from '../selectors';
const TermsContainer = connect(
state => {

View file

@ -5,7 +5,7 @@ import React from 'react';
import {render} from 'react-dom';
import rpc from './rpc';
import {init} from './actions/index';
import init from './actions/index';
import * as config from './utils/config';
import * as plugins from './utils/plugins';
import * as uiActions from './actions/ui';

View file

@ -2,7 +2,7 @@ import uuid from 'uuid';
import Immutable from 'seamless-immutable';
import {TERM_GROUP_EXIT, TERM_GROUP_RESIZE} from '../constants/term-groups';
import {SESSION_ADD, SESSION_SET_ACTIVE} from '../constants/sessions';
import {findBySession} from '../utils/term-groups';
import findBySession from '../utils/term-groups';
import {decorateTermGroupsReducer} from '../utils/plugins';
const MIN_SIZE = 0.05;

View file

@ -1,9 +1,11 @@
import {createSelector} from 'reselect';
const getTermGroups = ({termGroups}) => termGroups.termGroups;
export const getRootGroups = createSelector(
const getRootGroups = createSelector(
getTermGroups,
termGroups => Object.keys(termGroups)
.map(uid => termGroups[uid])
.filter(({parentUid}) => !parentUid)
);
export default getRootGroups;

View file

@ -1,3 +1,3 @@
export function last(arr) {
export default function last(arr) {
return arr[arr.length - 1];
}

View file

@ -19,7 +19,7 @@ const colorList = [
'grayscale'
];
export function getColorList(colors) {
export default function getColorList(colors) {
// For backwards compatibility, return early if it's already an array
if (Array.isArray(colors)) {
return colors;

View file

@ -10,7 +10,7 @@
* PR: https://github.com/kevva/executable/pull/10
*/
export function isExecutable(fileStat) {
export default function isExecutable(fileStat) {
if (process.platform === 'win32') {
return true;
}

View file

@ -1,4 +1,4 @@
export function findBySession(termGroupState, sessionUid) {
export default function findBySession(termGroupState, sessionUid) {
const {termGroups} = termGroupState;
return Object.keys(termGroups)
.map(uid => termGroups[uid])

View file

@ -23,7 +23,6 @@
"new-cap": 0,
"no-warning-comments": 0,
"complexity": 0,
"import/prefer-default-export": 0,
"react/prop-types": 0,
"react/jsx-no-bind": 0
},