From c55d3e9d4b9d2ea354e56504fd69b8aabd8e3445 Mon Sep 17 00:00:00 2001 From: allipierre Date: Fri, 24 Nov 2017 08:17:19 +0100 Subject: [PATCH] remove other rules in tslint.json --- types/confirmdialog/confirmdialog-tests.ts | 68 ++++++--------- types/confirmdialog/index.d.ts | 85 +++++++++---------- types/confirmdialog/tslint.json | 80 +---------------- types/jquery-notifier/index.d.ts | 5 +- .../jquery-notifier/jquery-notifier-tests.ts | 23 ++--- types/jquery-notifier/tslint.json | 80 +---------------- 6 files changed, 77 insertions(+), 264 deletions(-) diff --git a/types/confirmdialog/confirmdialog-tests.ts b/types/confirmdialog/confirmdialog-tests.ts index 47ba509dc4..cd2ad0e8ca 100644 --- a/types/confirmdialog/confirmdialog-tests.ts +++ b/types/confirmdialog/confirmdialog-tests.ts @@ -1,37 +1,27 @@ -namespace server { - export interface Iperson { - title: string, - content: string, - - - } -} - -class Confirm implements server.Iperson { +class Confirm { private title_: string; private conTent_: string; - constructor(public title: string, public content: string) { + constructor(title: string, content: string) { this.title_ = title; this.conTent_ = content; } - - public confirm() { + confirm() { $.confirm({ title: 'Confirm!', content: 'Simple confirm!', buttons: { - confirm: function() { + confirm: () => { $.alert('Confirmed!'); }, - cancel: function(cancel: string) { + cancel: (cancel: string) => { $.alert('Canceled! ' + cancel); }, somethingElse: { text: 'Something else', btnClass: 'btn-blue', keys: ['enter', 'shift'], - action: function() { + action: () => { alert('Something else?'); } } @@ -39,15 +29,14 @@ class Confirm implements server.Iperson { }); } - public alert() { + alert() { $.alert({ title: 'Alert!', content: 'Simple alert!', }); } - - public globalSettings(){ + globalSettings() { jconfirm.defaults = { title: 'Hello', titleClass: '', @@ -62,11 +51,11 @@ class Confirm implements server.Iperson { buttons: {}, defaultButtons: { ok: { - action: function () { + action: () => { } }, close: { - action: function () { + action: () => { } }, }, @@ -100,46 +89,41 @@ class Confirm implements server.Iperson { containerFluid: 'container-fluid', row: 'row', }, - onContentReady: function () {}, - onOpenBefore: function () {}, - onOpen: function () {}, - onClose: function () {}, - onDestroy: function () {}, - onAction: function () {} + onContentReady: () => {}, + onOpenBefore: () => {}, + onOpen: () => {}, + onClose: () => {}, + onDestroy: () => {}, + onAction: () => {} }; } - public api(){ - var jc = $.confirm({ + api() { + const jc = $.confirm({ title: 'awesome', - onContentReady: function(){ - // this === jc - //jc.setTitle(title: string); + onContentReady: () => { + jc.setTitle(); } }); } - - public confirm_84() { + confirm_84() { $.confirm({ closeIcon: true, buttons: { buttonA: { text: 'button a', - action: function (buttonA: HTMLElement) { - + action: (buttonA: string) => { return false; // prevent the modal from closing } }, - resetButton: function (resetButton: string) { + resetButton: (resetButton: string) => { } } }); } - } - -var firstName: string = 'Pierre'; -var lastName: string = 'Yotti'; -var type = new Confirm(firstName, lastName); +let firstName = 'Pierre'; +let lastName = 'Yotti'; +let type = new Confirm(firstName, lastName); diff --git a/types/confirmdialog/index.d.ts b/types/confirmdialog/index.d.ts index 9be4d62489..39a507f8ac 100644 --- a/types/confirmdialog/index.d.ts +++ b/types/confirmdialog/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for confirmdialog v3.3.0 +// Type definitions for confirmdialog 3.3 // Project: https://github.com/allipierre/Type-definitions-for-jquery-confirm/tree/master/types/confirmDialog-js // Definitions by: Alli Pierre Yotti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 + /// interface JQueryStatic { @@ -10,93 +11,83 @@ * confirm Dialog * @param {confirmOptions} pOtions */ - confirm( pOtions: options.confirmOptions | string, title?:string): boolean | void | HTMLElement | any; + confirm(pOtions: options.confirmOptions | string, title?: string): any; /** * confirm alert * @param {any} pMessage */ - alert( pMessage?: any | string, title?:string): void; + alert(pMessage?: any | string, title?: string): any; /** * confirm Dialog * @param {any} pMessage */ - dialog( pOtions: options.confirmOptions | string): void; - + dialog(pOtions: options.confirmOptions | string): any; } - interface JQuery { /** * confirm Dialog * @param {confirmOptions} pOtions */ - confirm( pOtions: options.confirmOptions | string, title?:string): boolean | void | HTMLElement | any; + confirm(pOtions: options.confirmOptions | string, title?: string): any; /** * confirm alert * @param {any} pMessage */ - alert( pMessage?: any, title?:string): void; + alert(pMessage?: any, title?: string): any; /** * confirm Dialog * @param {any} pMessage */ - dialog( pOtions: options.confirmOptions | any): void; + dialog(pOtions: options.confirmOptions | any): any; } interface Window { setContentAppend: any; } - - - declare namespace options { - interface confirmOptions { - buttons? : buttonOptionss | any, - title? : string | boolean, - content? : string | Function, - onContentReady?: Function, - lazyOpen?: boolean, - closeIcon?: boolean | Function, - type?: string, - typeAnimated?: boolean, - icon?: string, - closeIconClass?: string, - columnClass?: string, - containerFluid?: boolean, - boxWidth?: string, - useBootstrap?: boolean, - bootstrapClasses?: any, - draggable?: boolean, - dragWindowBorder?: boolean, - dragWindowGap?: number, - contentLoaded?: Function, - autoClose?: string, - backgroundDismiss?: boolean | Function | string, - backgroundDismissAnimation?: string, - escapeKey?: string | boolean, - onOpenBefore?:Function, - onOpen?: Function, - onClose?: Function, - onDestroy?: Function, - onAction?: Function - - + buttons?: buttonOptionss | any; + title?: string | boolean; + content?: any; + onContentReady?: any; + lazyOpen?: boolean; + closeIcon?: boolean | any; + type?: string; + typeAnimated?: boolean; + icon?: string; + closeIconClass?: string; + columnClass?: string; + containerFluid?: boolean; + boxWidth?: string; + useBootstrap?: boolean; + bootstrapClasses?: any; + draggable?: boolean; + dragWindowBorder?: boolean; + dragWindowGap?: number; + contentLoaded?: () => void; + autoClose?: string; + backgroundDismiss?: boolean | any | string; + backgroundDismissAnimation?: string; + escapeKey?: string | boolean; + onOpenBefore?: () => void; + onOpen?: () => void; + onClose?: () => void; + onDestroy?: () => void; + onAction?: () => void; } interface buttonOptionss { - cancel?: Function, - confirm?: Function + cancel?: () => void; + confirm?: () => void; } - } declare namespace jconfirm { let defaults: any; - } diff --git a/types/confirmdialog/tslint.json b/types/confirmdialog/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/confirmdialog/tslint.json +++ b/types/confirmdialog/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-notifier/index.d.ts b/types/jquery-notifier/index.d.ts index 4c733ce0df..855b3e50b1 100644 --- a/types/jquery-notifier/index.d.ts +++ b/types/jquery-notifier/index.d.ts @@ -1,9 +1,8 @@ -// Type definitions for Notifier +// Type definitions for notifier 1.0 // Project: https://github.com/allipierre/jquery-notifier // Definitions by: Alli Pierre Yotti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - declare namespace notifier { /** * notifier.show(title, msg, type, icon, timeout); @@ -14,6 +13,6 @@ declare namespace notifier { * @param {timeout} timeout */ function show(title: string, msg: string, type: string, icon: string, timeout?: number): string | number; - function hide(notificationId: string | number): boolean; + function hide(notificationId: string | number): boolean; } diff --git a/types/jquery-notifier/jquery-notifier-tests.ts b/types/jquery-notifier/jquery-notifier-tests.ts index 9d73bce3c5..18804758be 100644 --- a/types/jquery-notifier/jquery-notifier-tests.ts +++ b/types/jquery-notifier/jquery-notifier-tests.ts @@ -4,33 +4,28 @@ notifier.show('Well Done!', 'You just submit your resume successfuly.', '', '', notifier.show('Warning!', 'The data presented here can be change.', '', '', 0); notifier.show('Sorry!', 'Could not complete your transaction.', '', '', 0); - notifier.show('Default!', 'I am a default notification.', '', 'img/clock-48.png', 0); notifier.show('Reminder!', 'You have a meeting at 10:30 AM.', '', 'img/survey-48.png', 0); notifier.show('Well Done!', 'You just submit your resume successfuly.', '', 'img/ok-48.png', 0); notifier.show('Warning!', 'The data presented here can be change.', '', 'img/medium_priority-48.png', 0); notifier.show('Sorry!', 'Could not complete your transaction.', '', 'img/high_priority-48.png', 0); - - notifier.show('Default!', 'I am a default notification.', '', 'img/clock-48.png', 4000); notifier.show('Reminder!', 'You have a meeting at 10:30 AM.', '', 'img/survey-48.png', 4000); notifier.show('Well Done!', 'You just submit your resume successfuly.', '', 'img/ok-48.png', 4000); notifier.show('Warning!', 'The data presented here can be change.', '', 'img/medium_priority-48.png', 4000); notifier.show('Sorry!', 'Could not complete your transaction.', '', 'img/high_priority-48.png', 4000); +let notificationId: string | number; +let showNotification = () => { + notificationId = notifier.show('Reminder!', 'You have a meeting at 10:30 AM.', '', 'img/survey-48.png', 4000); +}; +let hideNotification = () => { + notifier.hide(notificationId); +}; - var notificationId:string | number; +document.querySelector('#btn-nt-show').addEventListener('click', showNotification); - var showNotification = function () { - notificationId = notifier.show('Reminder!', 'You have a meeting at 10:30 AM.', '', 'img/survey-48.png', 4000); - }; - - var hideNotification = function () { - notifier.hide(notificationId); - }; - - document.querySelector('#btn-nt-show').addEventListener('click', showNotification); - document.querySelector('#btn-nt-hide').addEventListener('click', hideNotification); +document.querySelector('#btn-nt-hide').addEventListener('click', hideNotification); diff --git a/types/jquery-notifier/tslint.json b/types/jquery-notifier/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/jquery-notifier/tslint.json +++ b/types/jquery-notifier/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" }