Skip to content

tslint related changes #814

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

Merged
merged 1 commit into from
Aug 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,20 @@ module.exports = function(grunt) {
sourceMap: false,
removeComments: true
}
}
},
},


tslint: {
build: {
files: {
src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "lib/common/test/unit-tests/**/*.ts", "definitions/**/*.ts", "!**/*.d.ts"]
},
options: {
configuration: grunt.file.readJSON("./tslint.json")
}
}
},

watch: {
devall: {
files: ["lib/**/*.ts", 'test/**/*.ts', "!lib/common/node_modules/**/*.ts"],
Expand Down Expand Up @@ -119,9 +130,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks("grunt-tslint");

grunt.registerTask("set_package_version", function(version) {
var fs = require("fs");
var buildVersion = version !== undefined ? version : buildNumber;
if (process.env["BUILD_CAUSE_GHPRBCAUSE"]) {
buildVersion = "PR" + buildVersion;
Expand Down Expand Up @@ -150,7 +161,6 @@ module.exports = function(grunt) {
grunt.file.write("package.json", JSON.stringify(packageJson, null, " "));
});


grunt.registerTask("test", ["ts:devall", "shell:npm_test"]);
grunt.registerTask("pack", [
"clean",
Expand All @@ -162,6 +172,7 @@ module.exports = function(grunt) {
"copy:package_to_drop_folder",
"copy:package_to_qa_drop_folder"
]);
grunt.registerTask("lint", ["tslint:build"]);

grunt.registerTask("default", "ts:devlib");
};
9 changes: 4 additions & 5 deletions lib/commands/add-library.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
///<reference path="../.d.ts"/>
"use strict";

import path = require("path");
import Future = require("fibers/future");
import * as path from "path";

export class AddLibraryCommand implements ICommand {
constructor(private $platformService: IPlatformService,
Expand All @@ -14,8 +13,8 @@ export class AddLibraryCommand implements ICommand {

execute(args: string[]): IFuture<void> {
return (() => {
var platform = args[0];
var libraryPath = path.resolve(args[1]);
let platform = args[0];
let libraryPath = path.resolve(args[1]);
this.$platformService.addLibrary(platform, libraryPath).wait();
this.$logger.info(`Library ${libraryPath} was successfully added for ${platform} platform.`);
}).future<void>()();
Expand Down Expand Up @@ -48,4 +47,4 @@ export class AddLibraryCommand implements ICommand {
}).future<boolean>()();
}
}
$injector.registerCommand("library|add", AddLibraryCommand);
$injector.registerCommand("library|add", AddLibraryCommand);
2 changes: 1 addition & 1 deletion lib/commands/add-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export class AddPlatformCommand implements ICommand {
}).future<boolean>()();
}
}
$injector.registerCommand("platform|add", AddPlatformCommand);
$injector.registerCommand("platform|add", AddPlatformCommand);
1 change: 0 additions & 1 deletion lib/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class BuildIosCommand extends BuildCommandBase implements ICommand {
}
$injector.registerCommand("build|ios", BuildIosCommand);


export class BuildAndroidCommand extends BuildCommandBase implements ICommand {
constructor($platformService: IPlatformService,
private $platformsData: IPlatformsData) {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export class CreateProjectCommand implements ICommand {
}).future<void>()();
}

allowedParameters = [new ProjectCommandParameter(this.$errors, this.$logger, this.$projectNameValidator) ]
allowedParameters = [new ProjectCommandParameter(this.$errors, this.$logger, this.$projectNameValidator) ];
}
$injector.registerCommand("create", CreateProjectCommand);
4 changes: 1 addition & 3 deletions lib/commands/init.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
///<reference path="../.d.ts"/>
"use strict";

import Future = require("fibers/future");

export class InitCommand implements ICommand {
constructor(private $initService: IInitService) { }

Expand All @@ -13,4 +11,4 @@ export class InitCommand implements ICommand {
return this.$initService.initialize();
}
}
$injector.registerCommand("init", InitCommand);
$injector.registerCommand("init", InitCommand);
4 changes: 1 addition & 3 deletions lib/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"use strict";

export class InstallCommand implements ICommand {
private _projectData: any;

constructor(private $platformsData: IPlatformsData,
private $platformService: IPlatformService,
private $projectData: IProjectData,
Expand Down Expand Up @@ -41,4 +39,4 @@ export class InstallCommand implements ICommand {
}).future<void>()();
}
}
$injector.registerCommand("install", InstallCommand);
$injector.registerCommand("install", InstallCommand);
5 changes: 2 additions & 3 deletions lib/commands/list-platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
"use strict";

import helpers = require("./../common/helpers");
import util = require("util")

export class ListPlatformsCommand implements ICommand {
constructor(private $platformService: IPlatformService,
private $logger: ILogger) { }

execute(args: string[]): IFuture<void> {
return (() => {
var installedPlatforms = this.$platformService.getInstalledPlatforms().wait();
let installedPlatforms = this.$platformService.getInstalledPlatforms().wait();

if(installedPlatforms.length > 0) {
var preparedPlatforms = this.$platformService.getPreparedPlatforms().wait();
let preparedPlatforms = this.$platformService.getPreparedPlatforms().wait();
if(preparedPlatforms.length > 0) {
this.$logger.out("The project is prepared for: ", helpers.formatListOfNames(preparedPlatforms, "and"));
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/livesync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export class LivesyncCommand implements ICommand {

allowedParameters: ICommandParameter[] = [];
}
$injector.registerCommand("livesync", LivesyncCommand);
$injector.registerCommand("livesync", LivesyncCommand);
2 changes: 1 addition & 1 deletion lib/commands/plugin/remove-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export class RemovePluginCommand implements ICommand {

public allowedParameters: ICommandParameter[] = [];
}
$injector.registerCommand("plugin|remove", RemovePluginCommand);
$injector.registerCommand("plugin|remove", RemovePluginCommand);
2 changes: 1 addition & 1 deletion lib/commands/remove-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export class RemovePlatformCommand implements ICommand {

allowedParameters: ICommandParameter[] = [];
}
$injector.registerCommand("platform|remove", RemovePlatformCommand);
$injector.registerCommand("platform|remove", RemovePlatformCommand);
2 changes: 1 addition & 1 deletion lib/commands/update-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export class UpdatePlatformCommand implements ICommand {

allowedParameters: ICommandParameter[] = [];
}
$injector.registerCommand("platform|update", UpdatePlatformCommand);
$injector.registerCommand("platform|update", UpdatePlatformCommand);
2 changes: 1 addition & 1 deletion lib/common
Submodule common updated 62 files
+3 −4 bplist-parser.ts
+7 −8 child-process.ts
+1 −3 commands/device/device-log-stream.ts
+1 −1 commands/device/list-applications.ts
+4 −11 commands/device/list-devices.ts
+1 −1 commands/device/list-files.ts
+1 −3 commands/device/run-application.ts
+1 −4 commands/device/stop-application.ts
+1 −1 commands/device/uninstall-application.ts
+0 −4 commands/help.ts
+0 −4 commands/post-install.ts
+1 −2 config-base.ts
+4 −4 decorators.ts
+1 −1 definitions/bplist-parser.d.ts
+0 −4 dispatchers.ts
+3 −2 errors.ts
+9 −9 file-system.ts
+4 −7 helpers.ts
+0 −2 host-info.ts
+24 −21 http-client.ts
+1 −1 logger.ts
+0 −1 mobile/android/android-application-manager.ts
+1 −4 mobile/android/android-debug-bridge.ts
+4 −3 mobile/android/android-device-file-system.ts
+2 −3 mobile/android/android-device.ts
+0 −1 mobile/android/android-emulator-services.ts
+0 −1 mobile/android/android-livesync-service.ts
+2 −1 mobile/constants.ts
+3 −4 mobile/device-app-data/device-app-data-base.ts
+1 −1 mobile/device-app-data/device-app-data-factory.ts
+1 −1 mobile/device-platforms-constants.ts
+3 −3 mobile/ios/ios-application-manager.ts
+12 −34 mobile/ios/ios-core.ts
+3 −3 mobile/ios/ios-device-file-system.ts
+11 −39 mobile/ios/ios-device.ts
+7 −9 mobile/ios/ios-emulator-services.ts
+17 −20 mobile/ios/ios-proxy-services.ts
+3 −4 mobile/local-to-device-path-data-factory.ts
+10 −11 mobile/mobile-core/device-discovery.ts
+3 −3 mobile/mobile-core/devices-services.ts
+5 −6 mobile/wp8/wp8-emulator-services.ts
+5 −7 options.ts
+1 −0 package.json
+3 −3 prompter.ts
+3 −3 properties-parser.ts
+2 −2 queue.ts
+2 −4 services/analytics-service.ts
+7 −7 services/auto-completion-service.ts
+4 −2 services/cancellation.ts
+11 −10 services/commands-service.ts
+2 −2 services/dynamic-help-service.ts
+5 −5 services/hooks-service.ts
+2 −3 services/html-help-service.ts
+4 −5 services/typescript-compilation-service.ts
+23 −20 services/usb-livesync-service-base.ts
+1 −1 services/user-settings-service.ts
+1 −2 static-config-base.ts
+4 −5 sysinfo.ts
+5 −9 test/unit-tests/decorators.ts
+2 −2 test/unit-tests/yok.ts
+1 −1 utils.ts
+5 −15 yok.ts
9 changes: 4 additions & 5 deletions lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
///<reference path=".d.ts"/>
"use strict";

import path = require("path");
import util = require("util");
import staticConfigBaseLibPath = require("./common/static-config-base");
import configBaseLib = require("./common/config-base");
import * as path from "path";
import * as staticConfigBaseLibPath from "./common/static-config-base";
import * as configBaseLib from "./common/config-base";

export class Configuration extends configBaseLib.ConfigBase implements IConfiguration { // User specific config
CI_LOGGER = false;
Expand Down Expand Up @@ -37,7 +36,7 @@ export class StaticConfig extends staticConfigBaseLibPath.StaticConfigBase imple
}

public get SYS_REQUIREMENTS_LINK(): string {
var linkToSysRequirements: string;
let linkToSysRequirements: string;
switch(process.platform) {
case "linux":
linkToSysRequirements = "http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-linux.html#system-requirements";
Expand Down
21 changes: 10 additions & 11 deletions lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
///<reference path=".d.ts"/>
"use strict";

export var APP_FOLDER_NAME = "app";
export var APP_RESOURCES_FOLDER_NAME = "App_Resources";
export var PROJECT_FRAMEWORK_FOLDER_NAME = "framework";
export var NATIVESCRIPT_KEY_NAME = "nativescript";
export var NODE_MODULES_FOLDER_NAME = "node_modules";
export var TNS_CORE_MODULES_NAME = "tns-core-modules";
export var PACKAGE_JSON_FILE_NAME = "package.json";
export var NODE_MODULE_CACHE_PATH_KEY_NAME = "node-modules-cache-path";
export var DEFAULT_APP_IDENTIFIER_PREFIX = "org.nativescript";
export let APP_FOLDER_NAME = "app";
export let APP_RESOURCES_FOLDER_NAME = "App_Resources";
export let PROJECT_FRAMEWORK_FOLDER_NAME = "framework";
export let NATIVESCRIPT_KEY_NAME = "nativescript";
export let NODE_MODULES_FOLDER_NAME = "node_modules";
export let TNS_CORE_MODULES_NAME = "tns-core-modules";
export let PACKAGE_JSON_FILE_NAME = "package.json";
export let NODE_MODULE_CACHE_PATH_KEY_NAME = "node-modules-cache-path";
export let DEFAULT_APP_IDENTIFIER_PREFIX = "org.nativescript";

export class ReleaseType {
static MAJOR = "major";
Expand All @@ -19,5 +20,3 @@ export class ReleaseType {
static PREPATCH = "prepatch";
static PRERELEASE = "prerelease";
}


2 changes: 1 addition & 1 deletion lib/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ interface IProjectFilesManager {

interface IInitService {
initialize(): IFuture<void>;
}
}
5 changes: 1 addition & 4 deletions lib/dynamic-help-provider.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
///<reference path=".d.ts"/>

"use strict";

import Future = require("fibers/future");

export class DynamicHelpProvider implements IDynamicHelpProvider {
constructor() { }

public isProjectType(args: string[]): IFuture<boolean> {
return Future.fromResult(true);
}

public getLocalVariables(options: { isHtml: boolean }): IFuture<IDictionary<any>> {
var localVariables: IDictionary<any> = {};
let localVariables: IDictionary<any> = {};
return Future.fromResult(localVariables);
}
}
Expand Down
8 changes: 4 additions & 4 deletions lib/lockfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import Future = require("fibers/future");
import lockfile = require("lockfile");
import path = require("path");
import * as path from "path";

export class LockFile implements ILockFile {
private lockFilePath: string;
Expand All @@ -20,7 +20,7 @@ export class LockFile implements ILockFile {
};

public lock(): IFuture<void> {
var future = new Future<void>();
let future = new Future<void>();
lockfile.lock(this.lockFilePath, LockFile.LOCK_PARAMS, (err: Error) => {
if(err) {
future.throw(err);
Expand All @@ -32,7 +32,7 @@ export class LockFile implements ILockFile {
}

public unlock(): IFuture<void> {
var future = new Future<void>();
let future = new Future<void>();
lockfile.unlock(this.lockFilePath, (err: Error) => {
if(err) {
future.throw(err);
Expand All @@ -43,4 +43,4 @@ export class LockFile implements ILockFile {
return future;
}
}
$injector.register("lockfile", LockFile);
$injector.register("lockfile", LockFile);
2 changes: 1 addition & 1 deletion lib/mobile-platforms-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class MobilePlatformsCapabilities implements Mobile.IPlatformsCapabilitie
companion: false,
hostPlatformsForDeploy: ["win32", "darwin", "linux"]
}
}
};

return this.platformCapabilities;
}
Expand Down
7 changes: 3 additions & 4 deletions lib/nativescript-cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
///<reference path=".d.ts"/>
"use strict";
import path = require("path");
require("./bootstrap");

import fiber = require("fibers");
Expand All @@ -9,11 +8,11 @@ import errors = require("./common/errors");
errors.installUncaughtExceptionListener();

fiber(() => {
var config = <Config.IConfig>$injector.resolve("$config");
var err = <IErrors>$injector.resolve("$errors");
let config = <Config.IConfig>$injector.resolve("$config");
let err = <IErrors>$injector.resolve("$errors");
err.printCallStack = config.DEBUG;

var commandDispatcher: ICommandDispatcher = $injector.resolve("commandDispatcher");
let commandDispatcher: ICommandDispatcher = $injector.resolve("commandDispatcher");

if (process.argv[2] === "completion") {
commandDispatcher.completeCommand().wait();
Expand Down
4 changes: 2 additions & 2 deletions lib/node-package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class NodePackageManager implements INodePackageManager {
}

public load(config?: any): IFuture<void> {
var future = new Future<void>();
let future = new Future<void>();
npm.load(config, (err) => {
if(err) {
future.throw(err);
Expand Down Expand Up @@ -75,7 +75,7 @@ export class NodePackageManager implements INodePackageManager {
} else {
future.return(data);
}
}
};
args.push(callback);

let command = subCommandName ? npm.commands[commandName][subCommandName] : npm.commands[commandName];
Expand Down
Loading