forked from phobal/ivideo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use airbnb eslint and add lint npm script
- Loading branch information
1 parent
2c233fc
commit 982c676
Showing
26 changed files
with
235 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,26 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"plugins": [ | ||
"react" | ||
], | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"modules": true | ||
}, | ||
"env": { | ||
"node": true, | ||
"extends": "eslint-config-airbnb", | ||
"env": { | ||
"browser": true, | ||
"mocha": true, | ||
"es6": true, | ||
"browser": true | ||
"node": true | ||
}, | ||
"globals": { | ||
"rules": { | ||
"react/jsx-uses-react": 2, | ||
"react/jsx-uses-vars": 2, | ||
"react/react-in-jsx-scope": 2, | ||
|
||
}, | ||
"rules": { | ||
"quotes": [2, "single"], | ||
"semi": [2, "never"], | ||
"curly": [2, "multi-line"], | ||
"no-underscore-dangle": 0, | ||
"no-var": 0, | ||
"vars-on-top": 0, | ||
"comma-dangle": 0, | ||
"no-use-before-define": 0, | ||
|
||
"react/display-name": 0, | ||
"react/jsx-boolean-value": 1, | ||
"react/jsx-quotes": 1, | ||
"react/jsx-no-undef": 1, | ||
"react/jsx-sort-props": 1, | ||
"react/jsx-sort-prop-types": 1, | ||
"react/jsx-uses-react": 1, | ||
"react/jsx-uses-vars": 1, | ||
"react/no-did-mount-set-state": 1, | ||
"react/no-did-update-set-state": 1, | ||
"react/no-multi-comp": 1, | ||
"react/no-unknown-property": 1, | ||
"react/prop-types": 1, | ||
"react/react-in-jsx-scope": 1, | ||
"react/self-closing-comp": 1, | ||
"react/sort-comp": 0, | ||
"react/wrap-multilines": 1 | ||
} | ||
//Temporarirly disabled due to a possible bug in babel-eslint (todomvc example) | ||
"block-scoped-var": 0, | ||
// Temporarily disabled for test/* until babel/babel-eslint#33 is resolved | ||
"padded-blocks": 0 | ||
}, | ||
"plugins": [ | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import createActions from '../utils/createActions' | ||
import createActions from '../utils/createActions'; | ||
|
||
|
||
export default createActions({ | ||
|
||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import keyMirror from 'keymirror' | ||
import keyMirror from 'keymirror'; | ||
|
||
|
||
export default keyMirror({ | ||
|
||
// Routes | ||
ROUTE_CHANGE: null | ||
|
||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import keyMirror from 'keymirror' | ||
import keyMirror from 'keymirror'; | ||
|
||
|
||
export default keyMirror({ | ||
SERVER_ACTION: null, | ||
VIEW_ACTION: null | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import Dispatcher from 'flux' | ||
import assign from 'object-assign' | ||
import PayloadSources from '../constants/PayloadSources' | ||
import debug from './utils/debug' | ||
import Dispatcher from 'flux'; | ||
import assign from 'object-assign'; | ||
import PayloadSources from '../constants/PayloadSources'; | ||
import debug from './utils/debug'; | ||
|
||
var dd = debug('AppDispatcher') | ||
var dd = debug('AppDispatcher'); | ||
|
||
|
||
export default assign(new Dispatcher(), { | ||
|
||
handleServerAction(action) { | ||
dd('server action', action) | ||
dd('server action', action); | ||
|
||
if (!action.type) { | ||
throw new Error('Empty action.type: you likely mistyped the action.') | ||
throw new Error('Empty action.type: you likely mistyped the action.'); | ||
} | ||
|
||
var payload = { | ||
source: PayloadSources.SERVER_ACTION, | ||
action: action | ||
} | ||
}; | ||
|
||
this.dispatch(payload) | ||
this.dispatch(payload); | ||
}, | ||
|
||
handleViewAction(action) { | ||
dd('view action', action) | ||
dd('view action', action); | ||
|
||
if (!action.type) { | ||
throw new Error('Empty action.type: you likely mistyped the action.') | ||
throw new Error('Empty action.type: you likely mistyped the action.'); | ||
} | ||
|
||
var payload = { | ||
source: PayloadSources.VIEW_ACTION, | ||
action: action | ||
} | ||
}; | ||
|
||
this.dispatch(payload) | ||
this.dispatch(payload); | ||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import React from 'react' | ||
import AppContainer from './containers/AppContainer' | ||
import router from './routes/router' | ||
import debug from './utils/debug' | ||
import './app.css' | ||
import React from 'react'; | ||
import AppContainer from './containers/AppContainer'; | ||
import router from './routes/router'; | ||
import debug from './utils/debug'; | ||
import './app.css'; | ||
|
||
var dd = debug('mainApp') | ||
var dd = debug('mainApp'); | ||
|
||
window.location.hash = '/' | ||
window.location.hash = '/'; | ||
|
||
router.run(function (Handler) { | ||
dd('router.run', Handler) | ||
React.render(<Handler />, document.getElementById('react-root')) | ||
router.run(Handler => { | ||
dd('router.run', Handler); | ||
React.render(<Handler />, document.getElementById('react-root')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = [ 'SomePage', 'ReadmePage' ] | ||
module.exports = [ 'SomePage', 'ReadmePage' ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import routes from './routes' | ||
import Router from 'react-router' | ||
import routes from './routes'; | ||
import Router from 'react-router'; | ||
|
||
|
||
// we can create a router before 'running' it | ||
export default Router.create({ | ||
routes: routes, | ||
location: Router.HashLocation | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import React from 'react' | ||
import { Route, DefaultRoute } from 'react-router' | ||
import AppContainer from '../containers/AppContainer' | ||
import HomePageContainer from '../containers/HomePageContainer' | ||
import AboutPageContainer from '../containers/AboutPageContainer' | ||
import React from 'react'; | ||
import { Route, DefaultRoute } from 'react-router'; | ||
import AppContainer from '../containers/AppContainer'; | ||
import HomePageContainer from '../containers/HomePageContainer'; | ||
import AboutPageContainer from '../containers/AboutPageContainer'; | ||
|
||
|
||
export default ( | ||
<Route path="/" handler={AppContainer}> | ||
<DefaultRoute name="home" handler={HomePageContainer} /> | ||
<Route name="about" handler={AboutPageContainer} /> | ||
</Route> | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import AppDispatcher from '../dispatcher/AppDispatcher' | ||
import ActionTypes from '../constants/ActionTypes' | ||
import createStore from '../utils/createStore' | ||
import AppDispatcher from '../dispatcher/AppDispatcher'; | ||
import ActionTypes from '../constants/ActionTypes'; | ||
import createStore from '../utils/createStore'; | ||
|
||
|
||
export default createStore({ | ||
|
||
}) | ||
}); | ||
|
||
|
||
AppDispatcher.register(function(payload) { | ||
var action = payload.action | ||
AppDispatcher.register(payload => { | ||
var action = payload.action; | ||
switch (action.type) { | ||
|
||
case ActionTypes.ROUTE_CHANGE: | ||
break; | ||
default: | ||
|
||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function createActions(attributes) { | ||
return attributes | ||
return attributes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import assign from 'object-assign' | ||
import { EventEmitter } from 'events' | ||
import assign from 'object-assign'; | ||
import { EventEmitter } from 'events'; | ||
|
||
|
||
var CHANGE_EVENT = 'change' | ||
var CHANGE_EVENT = 'change'; | ||
|
||
|
||
export default function(attributes) { | ||
return assign({}, EventEmitter.prototype, { | ||
|
||
emitChange() { | ||
this.emit(CHANGE_EVENT) | ||
this.emit(CHANGE_EVENT); | ||
}, | ||
|
||
addChangeListener(callback) { | ||
this.on(CHANGE_EVENT, callback) | ||
this.on(CHANGE_EVENT, callback); | ||
}, | ||
|
||
onChange(callback) { | ||
this.addChangeListener(callback) | ||
this.addChangeListener(callback); | ||
}, | ||
|
||
removeChangeListener(callback) { | ||
this.removeListener(CHANGE_EVENT, callback) | ||
this.removeListener(CHANGE_EVENT, callback); | ||
} | ||
|
||
}, attributes) | ||
}, attributes); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import debug from 'debug' | ||
import debug from 'debug'; | ||
|
||
global.dd = debug | ||
global.dd = debug; | ||
|
||
export default debug | ||
export default debug; |
Oops, something went wrong.