Skip to content

Commit d7f8f42

Browse files
committed
Merge pull request #818 from NativeScript/tslint
More tslint changes
2 parents 5050178 + 8472d76 commit d7f8f42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+770
-761
lines changed

lib/bootstrap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $injector.requireCommand("platform|add", "./commands/add-platform");
3333
$injector.requireCommand("platform|remove", "./commands/remove-platform");
3434
$injector.requireCommand("platform|update", "./commands/update-platform");
3535
$injector.requireCommand("library|add", "./commands/add-library");
36-
$injector.requireCommand("run|ios", "./commands/run");
36+
$injector.requireCommand("run|ios", "./commands/run");
3737
$injector.requireCommand("run|android", "./commands/run");
3838

3939
$injector.requireCommand("debug|ios", "./commands/debug");

lib/commands/add-library.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,25 @@ export class AddLibraryCommand implements ICommand {
2525
if (args.length !== 2) {
2626
this.$errors.fail("This command needs two parameters.");
2727
}
28-
29-
let platform = args[0];
30-
let platformLowerCase = platform.toLowerCase();
28+
29+
let platform = args[0];
30+
let platformLowerCase = platform.toLowerCase();
3131
let libraryPath = path.resolve(args[1]);
3232
if(platformLowerCase === "android") {
3333
if(!this.$fs.exists(path.join(libraryPath, "project.properties")).wait()) {
3434
let files = this.$fs.enumerateFilesInDirectorySync(libraryPath);
3535
if(!_.any(files, file => path.extname(file) === ".jar")) {
36-
this.$errors.failWithoutHelp("Invalid library path. Ensure that the library path is the file path to a directory containing one or more `*.jar` files or to a directory containing the `project.properties` files.");
36+
this.$errors.failWithoutHelp("Invalid library path. Ensure that the library path is the file path to a directory " +
37+
"containing one or more `*.jar` files or to a directory containing the `project.properties` files.");
3738
}
3839
}
3940
} else if(platformLowerCase === "ios") {
4041
if(path.extname(libraryPath) !== ".framework") {
41-
this.$errors.failWithoutHelp("Invalid library path. Ensure that the library path is a Cocoa Touch Framework with all build architectures enabled.");
42+
this.$errors.failWithoutHelp("Invalid library path. Ensure that the library path is a Cocoa Touch Framework with " +
43+
"all build architectures enabled.");
4244
}
4345
}
44-
46+
4547
this.$platformService.validatePlatformInstalled(args[0]);
4648
return true;
4749
}).future<boolean>()();

lib/commands/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
export class InitCommand implements ICommand {
55
constructor(private $initService: IInitService) { }
6-
6+
77
public allowedParameters: ICommandParameter[] = [];
88
public enableHooks = false;
9-
9+
1010
public execute(args: string[]): IFuture<void> {
1111
return this.$initService.initialize();
1212
}

lib/commands/install.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ export class InstallCommand implements ICommand {
88
private $projectDataService: IProjectDataService,
99
private $pluginsService: IPluginsService,
1010
private $logger: ILogger) { }
11-
11+
1212
public enableHooks = false;
13-
13+
1414
public allowedParameters: ICommandParameter[] = [];
15-
15+
1616
public execute(args: string[]): IFuture<void> {
1717
return (() => {
1818
let error: string = "";
19-
19+
2020
this.$pluginsService.ensureAllDependenciesAreInstalled().wait();
21-
21+
2222
this.$projectDataService.initialize(this.$projectData.projectDir);
2323
_.each(this.$platformsData.platformsNames, platform => {
2424
let platformData = this.$platformsData.getPlatformData(platform);
@@ -31,11 +31,11 @@ export class InstallCommand implements ICommand {
3131
}
3232
}
3333
});
34-
34+
3535
if(error) {
3636
this.$logger.error(error);
3737
}
38-
38+
3939
}).future<void>()();
4040
}
4141
}

lib/commands/list-platforms.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export class ListPlatformsCommand implements ICommand {
2020
}
2121
this.$logger.out("Installed platforms: ", helpers.formatListOfNames(installedPlatforms, "and"));
2222
} else {
23-
this.$logger.out("Available platforms for this OS: ", helpers.formatListOfNames(this.$platformService.getAvailablePlatforms().wait(), "and"));
23+
let formattedPlatformsList = helpers.formatListOfNames(this.$platformService.getAvailablePlatforms().wait(), "and");
24+
this.$logger.out("Available platforms for this OS: ", formattedPlatformsList);
2425
this.$logger.out("No installed platforms found. Use $ tns platform add");
2526
}
2627
}).future<void>()();

lib/commands/livesync.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ export class LivesyncCommand implements ICommand {
99
private $errors: IErrors) { }
1010

1111
public execute(args: string[]): IFuture<void> {
12-
this.$options.justlaunch = true;
12+
this.$options.justlaunch = true;
1313
return this.$usbLiveSyncService.liveSync(args[0]);
1414
}
15-
15+
1616
public canExecute(args: string[]): IFuture<boolean> {
1717
return (() => {
1818
if(args.length >= 2) {
1919
this.$errors.fail("Invalid number of arguments.");
2020
}
21-
21+
2222
let platform = args[0];
2323
if(platform) {
2424
return _.contains(this.$mobileHelper.platformNames, this.$mobileHelper.normalizePlatformName(platform));
2525
}
26-
26+
2727
return true;
2828
}).future<boolean>()();
2929
}
30-
30+
3131
allowedParameters: ICommandParameter[] = [];
3232
}
3333
$injector.registerCommand("livesync", LivesyncCommand);

lib/commands/plugin/add-plugin.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
export class AddPluginCommand implements ICommand {
55
constructor(private $pluginsService: IPluginsService,
66
private $errors: IErrors) { }
7-
7+
88
execute(args: string[]): IFuture<void> {
99
return this.$pluginsService.add(args[0]);
1010
}
11-
11+
1212
canExecute(args: string[]): IFuture<boolean> {
1313
return (() => {
1414
if(!args[0]) {
1515
this.$errors.fail("You must specify plugin name.");
1616
}
17-
17+
1818
let installedPlugins = this.$pluginsService.getAllInstalledPlugins().wait();
1919
let pluginName = args[0].toLowerCase();
2020
if(_.any(installedPlugins, (plugin: IPluginData) => plugin.name.toLowerCase() === pluginName)) {
2121
this.$errors.failWithoutHelp(`Plugin "${pluginName}" is already installed.`);
2222
}
23-
24-
return true;
23+
24+
return true;
2525
}).future<boolean>()();
2626
}
27-
27+
2828
public allowedParameters: ICommandParameter[] = [];
2929
}
3030
$injector.registerCommand("plugin|add", AddPluginCommand);

lib/commands/plugin/remove-plugin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
export class RemovePluginCommand implements ICommand {
55
constructor(private $pluginsService: IPluginsService,
66
private $errors: IErrors) { }
7-
7+
88
execute(args: string[]): IFuture<void> {
99
return this.$pluginsService.remove(args[0]);
1010
}
11-
11+
1212
canExecute(args: string[]): IFuture<boolean> {
1313
return (() => {
1414
if(!args[0]) {
1515
this.$errors.fail("You must specify plugin name.");
1616
}
17-
17+
1818
let installedPlugins = this.$pluginsService.getAllInstalledPlugins().wait();
1919
let pluginName = args[0].toLowerCase();
2020
if(!_.any(installedPlugins, (plugin: IPluginData) => plugin.name.toLowerCase() === pluginName)) {
2121
this.$errors.failWithoutHelp(`Plugin "${pluginName}" is not installed.`);
2222
}
23-
23+
2424
return true;
2525
}).future<boolean>()();
2626
}
27-
27+
2828
public allowedParameters: ICommandParameter[] = [];
2929
}
3030
$injector.registerCommand("plugin|remove", RemovePluginCommand);

lib/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class RunAndroidCommand extends RunCommandBase implements ICommand {
2828
private $platformsData: IPlatformsData) {
2929
super($platformService);
3030
}
31-
31+
3232
public allowedParameters: ICommandParameter[] = [];
3333

3434
public execute(args: string[]): IFuture<void> {

0 commit comments

Comments
 (0)