diff --git a/packages/connector-alipay-native/src/index.ts b/packages/connector-alipay-native/src/index.ts index 471974cbb..2e84fbad7 100644 --- a/packages/connector-alipay-native/src/index.ts +++ b/packages/connector-alipay-native/src/index.ts @@ -52,7 +52,8 @@ export default class AlipayNativeConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is AlipayConfig { diff --git a/packages/connector-aliyun-dm/src/index.ts b/packages/connector-aliyun-dm/src/index.ts index ed1605594..d6edc7429 100644 --- a/packages/connector-aliyun-dm/src/index.ts +++ b/packages/connector-aliyun-dm/src/index.ts @@ -21,7 +21,8 @@ export default class AliyunDmConnector extends EmailConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is AliyunDmConfig { diff --git a/packages/connector-aliyun-sms/src/index.ts b/packages/connector-aliyun-sms/src/index.ts index b54e04149..e548c9e16 100644 --- a/packages/connector-aliyun-sms/src/index.ts +++ b/packages/connector-aliyun-sms/src/index.ts @@ -16,7 +16,8 @@ export default class AliyunSmsConnector extends SmsConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is AliyunSmsConfig { diff --git a/packages/connector-apple/src/index.ts b/packages/connector-apple/src/index.ts index 4ec83179d..cc3c1f9ee 100644 --- a/packages/connector-apple/src/index.ts +++ b/packages/connector-apple/src/index.ts @@ -17,7 +17,8 @@ export default class AppleConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is AppleConfig { diff --git a/packages/connector-azuread/src/index.ts b/packages/connector-azuread/src/index.ts index 5adc90fd3..123877d5f 100644 --- a/packages/connector-azuread/src/index.ts +++ b/packages/connector-azuread/src/index.ts @@ -37,7 +37,8 @@ export default class AzureADConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is AzureADConfig { diff --git a/packages/connector-base-classes/src/index.ts b/packages/connector-base-classes/src/index.ts index d20dbb446..e5d8f26fb 100644 --- a/packages/connector-base-classes/src/index.ts +++ b/packages/connector-base-classes/src/index.ts @@ -27,10 +27,7 @@ export class BaseConnector { public validateConfig(config: unknown): asserts config is T {} // eslint-disable-next-line complexity - protected metadataParser = () => { - // eslint-disable-next-line unicorn/prefer-module - const currentPath = __dirname; - + protected metadataParser = (currentPath: string) => { if ( !this.metadata.logo.startsWith('http') && existsSync(path.join(currentPath, '..', this.metadata.logo)) diff --git a/packages/connector-facebook/src/index.ts b/packages/connector-facebook/src/index.ts index 27764be72..4dd64d9dd 100644 --- a/packages/connector-facebook/src/index.ts +++ b/packages/connector-facebook/src/index.ts @@ -37,7 +37,8 @@ export default class FacebookConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is FacebookConfig { diff --git a/packages/connector-github/src/index.ts b/packages/connector-github/src/index.ts index 915dabcd8..d6c718e6d 100644 --- a/packages/connector-github/src/index.ts +++ b/packages/connector-github/src/index.ts @@ -33,7 +33,8 @@ export default class GithubConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is GithubConfig { diff --git a/packages/connector-google/src/index.ts b/packages/connector-google/src/index.ts index ba4c18e9e..9fadcded4 100644 --- a/packages/connector-google/src/index.ts +++ b/packages/connector-google/src/index.ts @@ -35,7 +35,8 @@ export default class GoogleConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is GoogleConfig { diff --git a/packages/connector-mock-email/src/index.ts b/packages/connector-mock-email/src/index.ts index c597f72f4..c127816e3 100644 --- a/packages/connector-mock-email/src/index.ts +++ b/packages/connector-mock-email/src/index.ts @@ -17,7 +17,8 @@ export default class MockMailConnector extends EmailConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is MockMailConfig { diff --git a/packages/connector-mock-sms/src/index.ts b/packages/connector-mock-sms/src/index.ts index 29f6287e5..fccf8d8bc 100644 --- a/packages/connector-mock-sms/src/index.ts +++ b/packages/connector-mock-sms/src/index.ts @@ -17,7 +17,8 @@ export default class MockSmsConnector extends SmsConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is MockSmsConfig { diff --git a/packages/connector-mock-social/src/index.ts b/packages/connector-mock-social/src/index.ts index 4561bac0c..7a4f961a5 100644 --- a/packages/connector-mock-social/src/index.ts +++ b/packages/connector-mock-social/src/index.ts @@ -17,7 +17,8 @@ export default class MockSocialConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is SmtpConfig { diff --git a/packages/connector-twilio-sms/src/index.ts b/packages/connector-twilio-sms/src/index.ts index 47f3ad38a..f88515aa7 100644 --- a/packages/connector-twilio-sms/src/index.ts +++ b/packages/connector-twilio-sms/src/index.ts @@ -15,7 +15,8 @@ export default class TwilioSmsConnector extends SmsConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is TwilioSmsConfig { diff --git a/packages/connector-wechat-native/src/index.ts b/packages/connector-wechat-native/src/index.ts index 76703b676..0082a4de7 100644 --- a/packages/connector-wechat-native/src/index.ts +++ b/packages/connector-wechat-native/src/index.ts @@ -39,7 +39,8 @@ export default class WechatNativeConnector extends SocialConnector { constructor(getConnectorConfig: GetConnectorConfig) { super(getConnectorConfig); this.metadata = defaultMetadata; - this.metadataParser(); + // eslint-disable-next-line unicorn/prefer-module + this.metadataParser(__dirname); } public validateConfig(config: unknown): asserts config is WechatConfig {