mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
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:

committed by
Vladimir Enchev

parent
fd23197851
commit
05cd636fc8
@ -6,4 +6,3 @@ export function itemTap(args: observable.EventData) {
|
|||||||
moduleName: "gallery-app/" + args.object.get("tag"),
|
moduleName: "gallery-app/" + args.object.get("tag"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -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/**'"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,4 +36,3 @@ export function buttonTap(args: observable.EventData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
tests/app/ui/button/button-tests-native.d.ts
vendored
1
tests/app/ui/button/button-tests-native.d.ts
vendored
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -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;
|
||||||
|
@ -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 + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,4 +8,3 @@ declare module "js-libs/easysax" {
|
|||||||
public angularSyntax: boolean;
|
public angularSyntax: boolean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
tns-core-modules/text/text.d.ts
vendored
1
tns-core-modules/text/text.d.ts
vendored
@ -37,4 +37,3 @@ declare module "text" {
|
|||||||
export var UTF_8: any;
|
export var UTF_8: any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -535,7 +535,6 @@ namespace xml2ui {
|
|||||||
sourceTracker: this.sourceTracker
|
sourceTracker: this.sourceTracker
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -527,4 +527,3 @@ export function goBack(): boolean {
|
|||||||
export function stack(): Array<definition.Frame> {
|
export function stack(): Array<definition.Frame> {
|
||||||
return frameStack;
|
return frameStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
18
tsconfig.public.es2016.json
Normal file
18
tsconfig.public.es2016.json
Normal 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
18
tsconfig.public.es6.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
Reference in New Issue
Block a user