Bug 1230088 - Update Loop's use of eslint and eslint-plugin-react, fix warnings in latest versions and add a few more rules. r=mancus

This commit is contained in:
Mark Banner 2015-12-03 12:18:53 +00:00
parent 18548d2ef6
commit a26791cd5d
5 changed files with 15 additions and 9 deletions

View File

@ -59,6 +59,7 @@
"dot-location": [2, "property"],
"eol-last": 2,
"eqeqeq": [2, "smart"],
"generator-star-spacing": [2, {"before": false, "after": true}],
"jsx-quotes": [2, "prefer-double"],
"key-spacing": [2, {"beforeColon": false, "afterColon": true }],
"linebreak-style": [2, "unix"],
@ -71,6 +72,8 @@
"no-class-assign": 2,
"no-const-assign": 2,
"no-console": 0, // Leave as 0. We use console logging in content code.
"no-duplicate-case": 2,
"no-else-return": 2,
"no-empty": 2,
"no-empty-label": 2,
"no-eval": 2,
@ -99,6 +102,7 @@
"no-proto": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow": 2,
"no-shadow-restricted-names": 2,
@ -131,18 +135,19 @@
"yoda": [2, "never"],
// eslint-plugin-react rules. These are documented at
// <https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules>
"react/jsx-curly-spacing": [2, "never"],
"react/jsx-no-bind": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-sort-props": 2,
"react/jsx-sort-prop-types": 2,
"react/jsx-uses-vars": 2,
"react/jsx-no-duplicate-props": 2,
"react/no-did-mount-set-state": 2,
"react/no-did-update-set-state": 2,
"react/no-unknown-property": 2,
"react/prop-types": 2,
"react/self-closing-comp": 2,
"react/wrap-multilines": 2,
"react/jsx-curly-spacing": [2, "never"],
// Not worth it: React is defined globally
"react/jsx-uses-react": 0,
"react/react-in-jsx-scope": 0,

View File

@ -380,9 +380,9 @@ loop.panel = (function(_, mozL10n) {
var roomUrl = this.props.roomUrls && this.props.roomUrls[0];
if (roomUrl && roomUrl.location) {
return this._renderIcon(roomUrl);
} else {
return this._renderDefaultIcon();
}
return this._renderDefaultIcon();
}
});

View File

@ -380,9 +380,9 @@ loop.panel = (function(_, mozL10n) {
var roomUrl = this.props.roomUrls && this.props.roomUrls[0];
if (roomUrl && roomUrl.location) {
return this._renderIcon(roomUrl);
} else {
return this._renderDefaultIcon();
}
return this._renderDefaultIcon();
}
});

View File

@ -17,8 +17,9 @@ loop.shared.actions = (function() {
function Action(name, schema, values) {
var validatedData = new loop.validate.Validator(schema || {})
.validate(values || {});
for (var prop in validatedData)
for (var prop in validatedData) {
this[prop] = validatedData[prop];
}
this.name = name;
}

View File

@ -14,9 +14,9 @@
"devDependencies": {
"classnames": "2.2.x",
"compression": "1.5.x",
"eslint": "1.6.x",
"eslint": "1.10.x",
"eslint-plugin-mozilla": "../../../../testing/eslint-plugin-mozilla",
"eslint-plugin-react": "3.5.x",
"eslint-plugin-react": "3.10.x",
"exports-loader": "0.6.x",
"expose-loader": "0.7.x",
"express": "4.x",