[Pkg-javascript-commits] [backbone] 87/173: Add ESLint rule: no-lonely-if
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 07:44:06 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository backbone.
commit 04fe60fad5046c9e764641971032e20b76e988bc
Author: Jordan Eldredge <jordan at jordaneldredge.com>
Date: Wed Dec 16 07:40:43 2015 -0800
Add ESLint rule: no-lonely-if
---
.eslintrc | 1 +
backbone.js | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/.eslintrc b/.eslintrc
index 7088bbb..6abea69 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -47,6 +47,7 @@
"no-irregular-whitespace": 2,
"no-label-var": 2,
"no-lone-blocks": 2,
+ "no-lonely-if": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-negated-in-lhs": 1,
diff --git a/backbone.js b/backbone.js
index d5e82e7..74e53a1 100644
--- a/backbone.js
+++ b/backbone.js
@@ -619,8 +619,8 @@
// the model will be valid when the attributes, if any, are set.
if (attrs && !wait) {
if (!this.set(attrs, options)) return false;
- } else {
- if (!this._validate(attrs, options)) return false;
+ } else if (!this._validate(attrs, options)) {
+ return false;
}
// After a successful server-side save, the client is (optionally)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list