mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
refactor: follow only-arrow-functions lint rule
This commit is contained in:
parent
c1e1c5cb79
commit
9acbb9fcd6
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user