diff --git a/src/@ionic-native/core/decorators.ts b/src/@ionic-native/core/decorators.ts index 0fbb8164a..b1c266419 100644 --- a/src/@ionic-native/core/decorators.ts +++ b/src/@ionic-native/core/decorators.ts @@ -183,41 +183,41 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) { * ``` */ export function Plugin(config: PluginConfig): ClassDecorator { - return function(cls: any) { + return (cls: any) => { // Add these fields to the class for (const prop in config) { cls[prop] = config[prop]; } - cls['installed'] = function(printWarning?: boolean) { + cls['installed'] = (printWarning?: boolean) => { return !!getPlugin(config.pluginRef); }; - cls['getPlugin'] = function() { + cls['getPlugin'] = () => { return getPlugin(config.pluginRef); }; - cls['checkInstall'] = function() { + cls['checkInstall'] = () => { return checkAvailability(cls) === true; }; - cls['getPluginName'] = function() { + cls['getPluginName'] = () => { return config.pluginName; }; - cls['getPluginRef'] = function() { + cls['getPluginRef'] = () => { return config.pluginRef; }; - cls['getPluginInstallName'] = function() { + cls['getPluginInstallName'] = () => { return config.plugin; }; - cls['getPluginRepo'] = function() { + cls['getPluginRepo'] = () => { return config.repo; }; - cls['getSupportedPlatforms'] = function() { + cls['getSupportedPlatforms'] = () => { return config.platforms; }; diff --git a/src/@ionic-native/core/plugin.ts b/src/@ionic-native/core/plugin.ts index 847655855..6a07f5edd 100644 --- a/src/@ionic-native/core/plugin.ts +++ b/src/@ionic-native/core/plugin.ts @@ -355,11 +355,11 @@ export function overrideFunction( /** * @private */ -export const wrap = function( +export const wrap = ( pluginObj: any, methodName: string, opts: CordovaOptions = {} -) { +) => { return (...args: any[]) => { if (opts.sync) { // Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is diff --git a/tslint.json b/tslint.json index b74510e86..ea004313e 100644 --- a/tslint.json +++ b/tslint.json @@ -6,7 +6,6 @@ "no-redundant-jsdoc": false, "ban-types": false, "no-shadowed-variable": false, - "only-arrow-functions": false, "ter-no-proto": false, "adjacent-overload-signatures": false, "no-constant-condition": false,