Bug 1178270 - Upgrade Loop's use of eslint to the latest (0.24) and upgrade the eslint-plugin-react version (0.6.2). r=dmose

This commit is contained in:
Mark Banner 2015-07-03 10:49:00 +01:00
Родитель e885eca38f
Коммит 0544789525
13 изменённых файлов: 25 добавлений и 27 удалений

Просмотреть файл

@ -36,6 +36,7 @@
// Eslint built-in rules are documented at <http://eslint.org/docs/rules/>
"camelcase": 0, // TODO: Remove (use default)
"computed-property-spacing": [2, "never"],
"consistent-return": 0, // TODO: Remove (use default)
dot-location: 0, // [2, property],
"eqeqeq": 0, // TBD. Might need to be separate for content & chrome
@ -52,11 +53,14 @@
"no-redeclare": 0, // TODO: Remove (use default)
"no-return-assign": 0, // TODO: Remove (use default)
"no-underscore-dangle": 0, // Leave as 0. Commonly used for private variables.
"no-unexpected-multiline": 2,
"no-unneeded-ternary": 2,
"no-unused-expressions": 0, // TODO: Remove (use default)
"no-unused-vars": 0, // TODO: Remove (use default)
"no-use-before-define": 0, // TODO: Remove (use default)
"object-curly-spacing": 0, // [2, "always"],
"quotes": [2, "double", "avoid-escape"],
"spaced-comment": [2, "always"],
"strict": 0, // [2, "function"],
// eslint-plugin-react rules. These are documented at
// <https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules>

Просмотреть файл

@ -595,7 +595,8 @@ loop.roomViews = (function(mozL10n) {
// The poster URLs are for UI-showcase testing and development.
localPosterUrl: React.PropTypes.string,
mozLoop: React.PropTypes.object.isRequired,
remotePosterUrl: React.PropTypes.string
remotePosterUrl: React.PropTypes.string,
roomStore: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired
},
componentWillUpdate: function(nextProps, nextState) {

Просмотреть файл

@ -595,7 +595,8 @@ loop.roomViews = (function(mozL10n) {
// The poster URLs are for UI-showcase testing and development.
localPosterUrl: React.PropTypes.string,
mozLoop: React.PropTypes.object.isRequired,
remotePosterUrl: React.PropTypes.string
remotePosterUrl: React.PropTypes.string,
roomStore: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired
},
componentWillUpdate: function(nextProps, nextState) {

Просмотреть файл

@ -97,7 +97,7 @@ loop.shared.views.chat = (function(mozL10n) {
propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
messageList: React.PropTypes.array.isRequired
messageList: React.PropTypes.arrayOf(React.PropTypes.object).isRequired
},
getInitialState: function() {

Просмотреть файл

@ -97,7 +97,7 @@ loop.shared.views.chat = (function(mozL10n) {
propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
messageList: React.PropTypes.array.isRequired
messageList: React.PropTypes.arrayOf(React.PropTypes.object).isRequired
},
getInitialState: function() {

Просмотреть файл

@ -112,7 +112,6 @@ loop.validate = (function() {
*/
_dependencyMatchTypes: function(value, types) {
return types.some(function(Type) {
/*jshint eqeqeq:false*/
try {
return typeof Type === "undefined" || // skip checking
Type === null && value === null || // null type

Просмотреть файл

@ -15,7 +15,7 @@ const LOOP_SESSION_TYPE = {
FXA: 2
};
/***
/**
* Values that we segment 2-way media connection length telemetry probes
* into.
*
@ -614,7 +614,8 @@ let MozLoopServiceInternal = {
return this.hawkRequestInternal(sessionType, path, method, payloadObj, false);
},
() => {
return handle401Error(error); //Process the original error that triggered the retry.
// Process the original error that triggered the retry.
return handle401Error(error);
}
);
}
@ -916,10 +917,10 @@ let MozLoopServiceInternal = {
// Not ideal but insert our data amidst existing data like this:
// - 000 (id=00 url=http)
// + 000 (session=000 call=000 id=00 url=http)
var pair = pc.id.split("("); //)
var pair = pc.id.split("(");
if (pair.length == 2) {
pc.id = pair[0] + "(session=" + context.sessionId +
(context.callId ? " call=" + context.callId : "") + " " + pair[1]; //)
(context.callId ? " call=" + context.callId : "") + " " + pair[1];
}
}

Просмотреть файл

@ -223,7 +223,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
var urlCreationDateClasses = cx({
"light-color-font": true,
"call-url-date": true, /* Used as a handler in the tests */
/*hidden until date is available*/
// Hidden until date is available.
"hide": !this.props.urlCreationDateString.length
});

Просмотреть файл

@ -223,7 +223,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
var urlCreationDateClasses = cx({
"light-color-font": true,
"call-url-date": true, /* Used as a handler in the tests */
/*hidden until date is available*/
// Hidden until date is available.
"hide": !this.props.urlCreationDateString.length
});

Просмотреть файл

@ -12,8 +12,8 @@
},
"dependencies": {},
"devDependencies": {
"eslint": "0.21.x",
"eslint-plugin-react": "2.3.x",
"eslint": "0.24.x",
"eslint-plugin-react": "2.6.x",
"express": "4.x"
},
"scripts": {

Просмотреть файл

@ -18,19 +18,6 @@ describe("loop.conversationViews", function () {
var REST_ERRNOS = loop.shared.utils.REST_ERRNOS;
var WEBSOCKET_REASONS = loop.shared.utils.WEBSOCKET_REASONS;
// XXX refactor to Just Work with "sandbox.stubComponent" or else
// just pass in the sandbox and put somewhere generally usable
function stubComponent(obj, component, mockTagName){
var reactClass = React.createClass({
render: function() {
var tagName = mockTagName || "div";
return React.DOM[tagName](null, this.props.children);
}
});
return sandbox.stub(obj, component, reactClass);
}
beforeEach(function() {
sandbox = sinon.sandbox.create();
sandbox.useFakeTimers();

Просмотреть файл

@ -93,7 +93,8 @@ add_test(function test_reconnect_websocket() {
// The uaID is cleared to force re-regsitration of all notification channels.
add_test(function test_reopen_websocket() {
MozLoopPushHandler.uaID = undefined;
MozLoopPushHandler.registeredChannels = {}; //Do this to force a new registration callback.
// Do this to force a new registration callback.
MozLoopPushHandler.registeredChannels = {};
mockWebSocket.serverClose();
// Previously registered onRegistration callbacks will fire and be checked (see above).
});

Просмотреть файл

@ -25,6 +25,10 @@ window.queuedFrames = [];
*/
window.Frame = React.createClass({
propTypes: {
children: React.PropTypes.oneOfType([
React.PropTypes.element,
React.PropTypes.arrayOf(React.PropTypes.element)
]).isRequired,
className: React.PropTypes.string,
/* By default, <link rel="stylesheet> nodes from the containing frame's
head will be cloned into this iframe. However, if the link also has