Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(eslint): use cordova-eslint /w fix #405

Closed
wants to merge 1 commit into from
Closed

Conversation

timbru31
Copy link
Member

@timbru31 timbru31 commented Jul 2, 2020

Motivation and Context

Consistency across our codebase.

This is a bigger one. Changes of interest are noted as a review comment by myself.


exports.requestFileSystem = function (successCallback, errorCallback, args) {
var type = args[0];
// Size is ignored since IDB filesystem size depends
// on browser implementation and can't be set up by user
var size = args[1]; // eslint-disable-line no-unused-vars
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to allocate memory if the variable is not used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable? Already did. I just wanted to highlight this change, because the diff is pretty big and lots for "formatting".

};

exports.write = function (successCallback, errorCallback, args) {
var fileName = args[0];
var data = args[1];
var position = args[2];
var isBinary = args[3]; // eslint-disable-line no-unused-vars
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to allocate memory if the variable is not used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it.

@@ -521,7 +581,7 @@
}

// support for encodeURI
if (/\%5/g.test(path) || /\%20/g.test(path)) { // eslint-disable-line no-useless-escape
if (/%5/g.test(path) || /%20/g.test(path)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless escape of %

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it.

@@ -56,11 +57,6 @@
var File = require('./File');

(function (exports, global) {
var indexedDB = global.indexedDB || global.mozIndexedDB;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this check for Firefox( OS?). Caniuse is pretty green in terms of IndexedDB: https://caniuse.com/#feat=indexeddb

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If desired, I'll re-add the IndexedDB check and adjust the error message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not remove it in this PR.


FILESYSTEM_PROTOCOL = 'cdvfile'; // eslint-disable-line no-undef
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding a var keyword should have the same effect as omitting it. Using ES5 notation to retain compatibility. Same change applies to other files.

Copy link
Member

@erisu erisu Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, add var and remove the eslint-disable-line no-undef

@erisu
Copy link
Member

erisu commented Nov 15, 2022

Appears to already be added and used

@erisu erisu deleted the feat/eslint branch November 15, 2022 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants