npm scripts for typechecking public .d.ts-es and running tslint (#2934)

* npm scripts for typechecking public .d.ts-es and running tslint

* Update test.ts
This commit is contained in:
Panayot Cankov
2016-10-27 15:18:54 +03:00
committed by Vladimir Enchev
parent fd23197851
commit 05cd636fc8
20 changed files with 42 additions and 23 deletions

View File

@ -6,4 +6,3 @@ export function itemTap(args: observable.EventData) {
moduleName: "gallery-app/" + args.object.get("tag"), moduleName: "gallery-app/" + args.object.get("tag"),
}); });
} }

View File

@ -4,7 +4,7 @@
"curly": true, "curly": true,
"forin": false, "forin": false,
"indent": true, "indent": true,
"jsdoc-format": true, "jsdoc-format": false,
"max-line-length": [false, 120], "max-line-length": [false, 120],
"no-arg": true, "no-arg": true,
"no-consecutive-blank-lines": true, "no-consecutive-blank-lines": true,

View File

@ -28,7 +28,7 @@
"nativescript-typedoc-theme": "0.0.7", "nativescript-typedoc-theme": "0.0.7",
"shelljs": "^0.7.0", "shelljs": "^0.7.0",
"time-grunt": "1.3.0", "time-grunt": "1.3.0",
"tslint": "3.4.0", "tslint": "^3.15.1",
"typedoc": "0.4.5", "typedoc": "0.4.5",
"typescript": "^2.0.3" "typescript": "^2.0.3"
}, },
@ -53,6 +53,8 @@
"test-watch-ios": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync ios --path tests --watch\"", "test-watch-ios": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync ios --path tests --watch\"",
"prepublish": "echo \"Development reminder: npm run setup\n\"", "prepublish": "echo \"Development reminder: npm run setup\n\"",
"typedoc": "typedoc --tsconfig tsconfig.typedoc.json --out bin/dist/apiref --mode file --includeDeclarations --name NativeScript --theme ./node_modules/nativescript-typedoc-theme", "typedoc": "typedoc --tsconfig tsconfig.typedoc.json --out bin/dist/apiref --mode file --includeDeclarations --name NativeScript --theme ./node_modules/nativescript-typedoc-theme",
"dev-typedoc": "npm run typedoc && cd bin/dist/apiref && http-server" "dev-typedoc": "npm run typedoc && cd bin/dist/apiref && http-server",
"test-tsc-es2016": "tsc -p tsconfig.public.es2016.json",
"tslint": "tslint --config build/tslint.json 'tns-core-modules/**/*.ts' 'tests/**/*.ts' 'apps/**/*.ts' -e '**/node_modules/**' -e '**/platforms/**'"
} }
} }

View File

@ -84,8 +84,6 @@ export var testLocation = function (done) {
//TKUnit.waitUntilReady(isReady, 10); //TKUnit.waitUntilReady(isReady, 10);
//TKUnit.assert(true === locationReceived, locationReceived); //TKUnit.assert(true === locationReceived, locationReceived);
}; };

View File

@ -36,4 +36,3 @@ export function buttonTap(args: observable.EventData) {
} }
} }
} }

View File

@ -38,4 +38,3 @@ export function testIsIOSandIsAndroid() {
TKUnit.assertTrue(!!android, "isAndroid is true but common 'android' package is not available."); TKUnit.assertTrue(!!android, "isAndroid is true but common 'android' package is not available.");
} }
} }

View File

@ -9,4 +9,3 @@ export declare function getNativeColor(button: buttonModule.Button): colorModule
export declare function getNativeBackgroundColor(button: buttonModule.Button): colorModule.Color; export declare function getNativeBackgroundColor(button: buttonModule.Button): colorModule.Color;
export declare function getNativeTextAlignment(button: buttonModule.Button): string; export declare function getNativeTextAlignment(button: buttonModule.Button): string;
export declare function performNativeClick(button: buttonModule.Button): void; export declare function performNativeClick(button: buttonModule.Button): void;

View File

@ -8,5 +8,3 @@ export function selectNativeItem(listPicker: listPickerModule.ListPicker, index:
listPicker.ios.selectRowInComponentAnimated(index, 0, false); listPicker.ios.selectRowInComponentAnimated(index, 0, false);
(<UIPickerViewDelegate>(<any>listPicker)._delegate).pickerViewDidSelectRowInComponent(listPicker.ios, index, 0); (<UIPickerViewDelegate>(<any>listPicker)._delegate).pickerViewDidSelectRowInComponent(listPicker.ios, index, 0);
} }

View File

@ -800,7 +800,6 @@ export class ListViewTest extends testModule.UITest<listViewModule.ListView> {
TKUnit.assertEqual(templateKey1, "green", "itemTemplateSelector result for second item"); TKUnit.assertEqual(templateKey1, "green", "itemTemplateSelector result for second item");
} }
public test_ItemTemplateSelector_IsCorrectlyUsedAsAFunction() { public test_ItemTemplateSelector_IsCorrectlyUsedAsAFunction() {
let listView = this.testView; let listView = this.testView;
listView.itemTemplateSelector = selectItemTemplate; listView.itemTemplateSelector = selectItemTemplate;

View File

@ -453,4 +453,3 @@ function getChildAt(repeater: repeaterModule.Repeater, index: number): viewModul
function getChildAtText(repeater: repeaterModule.Repeater, index: number): string { function getChildAtText(repeater: repeaterModule.Repeater, index: number): string {
return (<labelModule.Label>getChildAt(repeater, index)).text + ""; return (<labelModule.Label>getChildAt(repeater, index)).text + "";
} }

View File

@ -8,4 +8,3 @@ export function getNativeHintColor(searchBar: SearchBar): Color {
export function getNativeFontSize(searchBar: SearchBar): number { export function getNativeFontSize(searchBar: SearchBar): number {
return (<any>searchBar)._textField ? (<any>searchBar)._textField.font.pointSize : undefined; return (<any>searchBar)._textField ? (<any>searchBar)._textField.font.pointSize : undefined;
} }

View File

@ -34,4 +34,3 @@ if (global.TNS_WEBPACK) {
global.registerModule("ui/text-view", () => require("ui/text-view")) global.registerModule("ui/text-view", () => require("ui/text-view"))
global.registerModule("ui/time-picker", () => require("ui/time-picker")) global.registerModule("ui/time-picker", () => require("ui/time-picker"))
} }

View File

@ -8,4 +8,3 @@ declare module "js-libs/easysax" {
public angularSyntax: boolean; public angularSyntax: boolean;
} }
} }

View File

@ -37,4 +37,3 @@ declare module "text" {
export var UTF_8: any; export var UTF_8: any;
} }
} }

View File

@ -1,6 +1,4 @@
/** //iOS specific timer functions implementation.
* iOS specific timer functions implementation.
*/
var timeoutCallbacks = new Map<number, KeyValuePair<NSTimer, TimerTargetImpl>>(); var timeoutCallbacks = new Map<number, KeyValuePair<NSTimer, TimerTargetImpl>>();
var timerId = 0; var timerId = 0;

View File

@ -64,7 +64,6 @@ export function write(message: any, category: string, type?: number) {
return; return;
} }
for (i = 0; i < _writers.length; i++) { for (i = 0; i < _writers.length; i++) {
_writers[i].write(message, category, type); _writers[i].write(message, category, type);
} }

View File

@ -536,7 +536,6 @@ namespace xml2ui {
}); });
} }
} else { } else {
var componentModule: ComponentModule; var componentModule: ComponentModule;

View File

@ -527,4 +527,3 @@ export function goBack(): boolean {
export function stack(): Array<definition.Frame> { export function stack(): Array<definition.Frame> {
return frameStack; return frameStack;
} }

View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"noEmitOnError": true,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"experimentalDecorators": true,
"lib": [
"es2016"
]
},
"files": [
"tns-core-modules/tns-core-modules.es2016.d.ts"
]
}

18
tsconfig.public.es6.json Normal file
View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"noEmitOnError": true,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"experimentalDecorators": true,
"lib": [
"es6"
]
},
"files": [
"tns-core-modules/tns-core-modules.es6.d.ts"
]
}