Skip to content

Commit c2b63e2

Browse files
committed
update eslint
1 parent c0876b0 commit c2b63e2

File tree

9 files changed

+347
-188
lines changed

9 files changed

+347
-188
lines changed

.eslintrc.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
module.exports = {
2-
extends: 'eslint-config-75team',
2+
extends: 'eslint-config-sprite',
33
plugins: ['html'],
44
globals: {
55
Timeline: true,
66
},
77
rules: {
8-
// 'import/no-mutable-exports': 'off',
9-
'semi-style': ["error", "first"],
10-
// 禁止一个文件中在忽略空行和注释之后行数超过1500行
11-
'max-lines': ['error', {
12-
max: 1500,
13-
skipBlankLines: true,
14-
skipComments: true
15-
}],
16-
'no-loop-func': 'off',
17-
'guard-for-in': 'off',
18-
'no-multi-assign': 'warn',
19-
'max-params': ['warn', 10],
20-
'prefer-const': ['error', { destructuring: 'all' }],
21-
// 因为我们可能模块内定义一个 decorate,这个 decorate 有可能和变量同名
22-
'no-shadow': 'warn',
23-
// 因为函数签名中可能声明未使用的变量
24-
'no-unused-vars': ['error', { args: "none" }],
25-
'prefer-destructuring': 'off',
26-
'object-curly-newline': 'off',
8+
279
},
2810
};

dist/sprite-timeline.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ var Timeline = function () {
279279
while (m > l && m < r) {
280280
if (entropy === timeMark[m].entropy) {
281281
return m;
282-
} else if (entropy < timeMark[m].entropy) {
282+
}if (entropy < timeMark[m].entropy) {
283283
r = m;
284284
} else if (entropy > timeMark[m].entropy) {
285285
l = m;
@@ -342,6 +342,7 @@ var Timeline = function () {
342342
_this2.clearTimeout(id);
343343
});
344344
}
345+
345346
/*
346347
setTimeout(func, {delay: 100, isEntropy: true})
347348
setTimeout(func, {entropy: 100})
@@ -484,6 +485,7 @@ var Timeline = function () {
484485
});
485486
this.updateTimers();
486487
}
488+
487489
// Both currentTime and entropy should be influenced by playbackRate.
488490
// If current playbackRate is negative, the currentTime should go backwards
489491
// while the entropy remain to go forwards.
@@ -499,6 +501,7 @@ var Timeline = function () {
499501
return entropy + Math.abs((this.globalEntropy - globalEntropy) * this.playbackRate);
500502
},
501503

504+
502505
// change entropy will NOT cause currentTime changing but may influence the pass
503506
// and the future of the timeline. (It may change the result of seek***Time)
504507
// While entropy is set, all the marks behind will be droped
@@ -2887,7 +2890,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
28872890
function nowtime() {
28882891
if (typeof performance !== 'undefined' && performance.now) {
28892892
return performance.now();
2890-
} else if (typeof process !== 'undefined' && process.hrtime) {
2893+
}if (typeof process !== 'undefined' && process.hrtime) {
28912894
var _process$hrtime = process.hrtime(),
28922895
_process$hrtime2 = (0, _slicedToArray3.default)(_process$hrtime, 2),
28932896
s = _process$hrtime2[0],

lib/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ var Timeline = function () {
163163
while (m > l && m < r) {
164164
if (entropy === timeMark[m].entropy) {
165165
return m;
166-
} else if (entropy < timeMark[m].entropy) {
166+
}if (entropy < timeMark[m].entropy) {
167167
r = m;
168168
} else if (entropy > timeMark[m].entropy) {
169169
l = m;
@@ -226,6 +226,7 @@ var Timeline = function () {
226226
_this2.clearTimeout(id);
227227
});
228228
}
229+
229230
/*
230231
setTimeout(func, {delay: 100, isEntropy: true})
231232
setTimeout(func, {entropy: 100})
@@ -368,6 +369,7 @@ var Timeline = function () {
368369
});
369370
this.updateTimers();
370371
}
372+
371373
// Both currentTime and entropy should be influenced by playbackRate.
372374
// If current playbackRate is negative, the currentTime should go backwards
373375
// while the entropy remain to go forwards.
@@ -383,6 +385,7 @@ var Timeline = function () {
383385
return entropy + Math.abs((this.globalEntropy - globalEntropy) * this.playbackRate);
384386
},
385387

388+
386389
// change entropy will NOT cause currentTime changing but may influence the pass
387390
// and the future of the timeline. (It may change the result of seek***Time)
388391
// While entropy is set, all the marks behind will be droped

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
1616
function nowtime() {
1717
if (typeof performance !== 'undefined' && performance.now) {
1818
return performance.now();
19-
} else if (typeof process !== 'undefined' && process.hrtime) {
19+
}if (typeof process !== 'undefined' && process.hrtime) {
2020
var _process$hrtime = process.hrtime(),
2121
_process$hrtime2 = (0, _slicedToArray3.default)(_process$hrtime, 2),
2222
s = _process$hrtime2[0],

0 commit comments

Comments
 (0)