Ensure to lint as many files as possible (#854)

* Lint everything, including bins w/out extension

* Apply eslint --fix to all linted files

* Manually fix all remaining lint rule violations

* Remove ESLint inline config
This commit is contained in:
Raphael von der Grün
2019-10-21 18:26:17 +02:00
committed by GitHub
parent c35a990c09
commit 5dfa995a4b
11 changed files with 147 additions and 153 deletions
+3 -7
View File
@@ -16,8 +16,6 @@
specific language governing permissions and limitations
under the License.
*/
/* eslint no-self-assign: 0 */
/* eslint no-unused-vars: 0 */
var Q = require('q');
var fs = require('fs');
@@ -356,7 +354,7 @@ function findOutputApksHelper (dir, build_type, arch) {
return true;
}).sort(apkSorter);
shellSilent = shellSilent;
shell.config.silent = shellSilent;
if (ret.length === 0) {
return ret;
@@ -381,10 +379,6 @@ function findOutputApksHelper (dir, build_type, arch) {
// While replacing shell with fs-extra, it might be a good idea to see if we can
// generalise these findOutput methods.
function findOutputBundlesHelper (dir, build_type) {
// This is an unused variable that was copied from findOutputApksHelper
// we are pretty sure it was meant to reset shell.config.silent back to
// the original value. However shell is planned to be replaced,
// it was left as is to avoid unintended consequences.
const shellSilent = shell.config.silent;
shell.config.silent = true;
@@ -404,6 +398,8 @@ function findOutputBundlesHelper (dir, build_type) {
return true;
});
shell.config.silent = shellSilent;
return ret;
}
+3 -4
View File
@@ -16,7 +16,6 @@
specific language governing permissions and limitations
under the License.
*/
/* eslint no-useless-escape: 0 */
var Q = require('q');
var fs = require('fs');
@@ -186,11 +185,11 @@ function updateProjectAccordingTo (platformConfig, locations) {
var strings = xmlHelpers.parseElementtreeSync(locations.strings);
var name = platformConfig.name();
strings.find('string[@name="app_name"]').text = name.replace(/\'/g, '\\\'');
strings.find('string[@name="app_name"]').text = name.replace(/'/g, '\\\'');
var shortName = platformConfig.shortName && platformConfig.shortName();
if (shortName && shortName !== name) {
strings.find('string[@name="launcher_name"]').text = shortName.replace(/\'/g, '\\\'');
strings.find('string[@name="launcher_name"]').text = shortName.replace(/'/g, '\\\'');
}
fs.writeFileSync(locations.strings, strings.write({ indent: 4 }), 'utf-8');
@@ -225,7 +224,7 @@ function updateProjectAccordingTo (platformConfig, locations) {
var destFile = path.join(locations.root, 'app', 'src', 'main', 'java', androidPkgName.replace(/\./g, '/'), path.basename(java_files[0]));
shell.mkdir('-p', path.dirname(destFile));
shell.sed(/package [\w\.]*;/, 'package ' + androidPkgName + ';', java_files[0]).to(destFile);
shell.sed(/package [\w.]*;/, 'package ' + androidPkgName + ';', java_files[0]).to(destFile);
events.emit('verbose', 'Wrote out Android package name "' + androidPkgName + '" to ' + destFile);
var removeOrigPkg = checkReqs.isWindows() || checkReqs.isDarwin() ?
+1 -1
View File
@@ -20,7 +20,7 @@
*/
// Coho updates this line:
var VERSION = "8.2.0-dev";
var VERSION = '8.2.0-dev';
module.exports.version = VERSION;