Enable the no-else-return
ESLint rule
Using `else` after `return` is not necessary, and can often lead to unnecessarily cluttered code. By using the `no-else-return` rule in ESLint we can avoid this pattern, see http://eslint.org/docs/rules/no-else-return.
This commit is contained in:
parent
049d7fa277
commit
4046d67fde
19 changed files with 67 additions and 79 deletions
|
@ -81,9 +81,8 @@ AnnotationElementFactory.prototype =
|
|||
return new RadioButtonWidgetAnnotationElement(parameters);
|
||||
} else if (parameters.data.checkBox) {
|
||||
return new CheckboxWidgetAnnotationElement(parameters);
|
||||
} else {
|
||||
warn('Unimplemented button widget annotation: pushbutton');
|
||||
}
|
||||
warn('Unimplemented button widget annotation: pushbutton');
|
||||
break;
|
||||
case 'Ch':
|
||||
return new ChoiceWidgetAnnotationElement(parameters);
|
||||
|
|
|
@ -1945,9 +1945,8 @@ var PDFObjects = (function PDFObjectsClosure() {
|
|||
|
||||
if (!objs[objId]) {
|
||||
return false;
|
||||
} else {
|
||||
return objs[objId].resolved;
|
||||
}
|
||||
return objs[objId].resolved;
|
||||
},
|
||||
|
||||
hasData: function PDFObjects_hasData(objId) {
|
||||
|
@ -1961,9 +1960,8 @@ var PDFObjects = (function PDFObjectsClosure() {
|
|||
var objs = this.objs;
|
||||
if (!objs[objId] || !objs[objId].resolved) {
|
||||
return null;
|
||||
} else {
|
||||
return objs[objId].data;
|
||||
}
|
||||
return objs[objId].data;
|
||||
},
|
||||
|
||||
clear: function PDFObjects_clear() {
|
||||
|
|
|
@ -376,7 +376,7 @@ var FontFaceObject = (function FontFaceObjectClosure() {
|
|||
this.options.fontRegistry.registerFont(this);
|
||||
}
|
||||
return nativeFontFace;
|
||||
} else {
|
||||
} else { // eslint-disable-line no-else-return
|
||||
throw new Error('Not implemented: createNativeFontFace');
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue