Use eslint, add travis-ci

This commit is contained in:
Horcrux
2016-05-04 17:54:30 +08:00
parent be8c273adf
commit cbce096b5c
41 changed files with 93 additions and 297 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import SerializablePath from 'react-native/Libraries/ART/ARTSerializablePath';
import _ from 'lodash';
const newLine = /\n/g;
const defaultFontFamily = '"Helvetica Neue", "Helvetica", Arial';
const fontRegExp = /^\s*((?:(?:normal|bold|italic)\s+)*)(?:(\d+(?:\.\d+)?)[ptexm%]*(?:\s*\/.*?)?\s+)?\s*"?([^"]*)/i;
@@ -58,7 +58,7 @@ function parseFontString(font) {
}
function extractFont(font) {
if (font == null) {
if (_.isNil(font)) {
return null;
}
if (typeof font === 'string') {
+7 -6
View File
@@ -1,11 +1,12 @@
import Transform from '../Transform';
let pooledTransform = new Transform;
import _ from 'lodash';
let pooledTransform = new Transform();
function transformToMatrix(props) {
let scaleX = props.scaleX != null ? props.scaleX :
props.scale != null ? props.scale : 1;
let scaleY = props.scaleY != null ? props.scaleY :
props.scale != null ? props.scale : 1;
let scaleX = !_.isNil(props.scaleX) ? props.scaleX :
!_.isNil(props.scale) ? props.scale : 1;
let scaleY = !_.isNil(props.scaleY) ? props.scaleY :
!_.isNil(props.scale) ? props.scale : 1;
pooledTransform
.transformTo(1, 0, 0, 1, 0, 0)
@@ -13,7 +14,7 @@ function transformToMatrix(props) {
.rotate(props.rotation || 0, props.originX, props.originY)
.scale(scaleX, scaleY, props.originX, props.originY);
if (props.transform != null) {
if (!_.isNil(props.transform)) {
pooledTransform.transform(props.transform);
}