mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 07:38:07 +02:00
Enable the mozilla/use-includes-instead-of-indexOf
ESLint rule globally
This rule is available from https://www.npmjs.com/package/eslint-plugin-mozilla, and is enforced in mozilla-central. Note that we have the necessary `Array`/`String` polyfills and that most cases have already been fixed, see PRs 9032 and 9434.
This commit is contained in:
parent
2eb29409bc
commit
1cf116ab88
14 changed files with 21 additions and 17 deletions
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* eslint-disable object-shorthand */
|
||||
/* eslint-disable object-shorthand, mozilla/use-includes-instead-of-indexOf */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
|
|||
self.manifest = JSON.parse(r.responseText);
|
||||
if (self.testFilter && self.testFilter.length) {
|
||||
self.manifest = self.manifest.filter(function(item) {
|
||||
return self.testFilter.indexOf(item.id) !== -1;
|
||||
return self.testFilter.includes(item.id);
|
||||
});
|
||||
}
|
||||
self.currentTask = 0;
|
||||
|
@ -433,7 +433,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
|
|||
}
|
||||
}
|
||||
|
||||
if (task.skipPages && task.skipPages.indexOf(task.pageNum) >= 0) {
|
||||
if (task.skipPages && task.skipPages.includes(task.pageNum)) {
|
||||
this._log(' Skipping page ' + task.pageNum + '/' +
|
||||
task.pdfDoc.numPages + '...\n');
|
||||
task.pageNum++;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable mozilla/use-includes-instead-of-indexOf */
|
||||
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* eslint-disable object-shorthand */
|
||||
/* eslint-disable object-shorthand, mozilla/use-includes-instead-of-indexOf */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue