From 8128e02daaefa52c07fe88c98488428e884ee28f Mon Sep 17 00:00:00 2001 From: Michael Wuergler Date: Fri, 27 Sep 2024 23:26:16 +0200 Subject: [PATCH] refactor: use ts imports --- src/classes/logger.class.ts | 6 +++--- src/classes/problem-store.class.ts | 4 ++-- src/classes/problem.class.ts | 2 +- src/config/default-config.ts | 2 +- src/engine/rule-engine.ts | 14 +++++++------- src/index.ts | 6 +++--- src/rules/index.ts | 18 +++++++++--------- src/rules/no-empty-messages/index.ts | 2 +- .../no-empty-messages.spec.ts | 8 ++++---- .../no-empty-messages/no-empty-messages.ts | 6 +++--- src/rules/no-empty-messages/problems.ts | 4 ++-- src/rules/no-extra-whitespace/index.ts | 2 +- .../no-extra-whitespace.spec.ts | 8 ++++---- .../no-extra-whitespace/no-extra-whitespace.ts | 8 ++++---- src/rules/no-extra-whitespace/problems.ts | 4 ++-- src/rules/no-html-messages/index.ts | 2 +- .../no-html-messages/no-html-messages.spec.ts | 8 ++++---- src/rules/no-html-messages/no-html-messages.ts | 8 ++++---- src/rules/no-html-messages/problems.ts | 4 ++-- src/rules/no-invalid-configuration/index.ts | 2 +- .../no-invalid-configuration.spec.ts | 8 ++++---- .../no-invalid-configuration.ts | 8 ++++---- src/rules/no-invalid-configuration/problems.ts | 4 ++-- src/rules/no-invalid-severity/index.ts | 2 +- .../no-invalid-severity.spec.ts | 8 ++++---- .../no-invalid-severity/no-invalid-severity.ts | 6 +++--- src/rules/no-invalid-severity/problems.ts | 6 +++--- src/rules/no-invalid-variables/index.ts | 2 +- .../no-invalid-variables.spec.ts | 8 ++++---- .../no-invalid-variables.ts | 8 ++++---- src/rules/no-invalid-variables/problems.ts | 4 ++-- src/rules/no-malformed-keys/index.ts | 2 +- .../no-malformed-keys.spec.ts | 8 ++++---- .../no-malformed-keys/no-malformed-keys.ts | 8 ++++---- src/rules/no-malformed-keys/problems.ts | 4 ++-- src/rules/no-missing-keys/index.ts | 2 +- .../no-missing-keys/no-missing-keys.spec.ts | 8 ++++---- src/rules/no-missing-keys/no-missing-keys.ts | 6 +++--- src/rules/no-missing-keys/problems.ts | 4 ++-- src/rules/no-untranslated-messages/index.ts | 2 +- .../no-untranslated-messages.spec.ts | 8 ++++---- .../no-untranslated-messages.ts | 6 +++--- src/rules/no-untranslated-messages/problems.ts | 4 ++-- src/types.ts | 4 ++-- src/utils/config-helpers.spec.ts | 4 ++-- src/utils/config-helpers.ts | 2 +- src/utils/file-helpers.spec.ts | 4 ++-- src/utils/file-helpers.ts | 2 +- src/utils/message-helpers.spec.ts | 2 +- src/utils/rules-helpers.spec.ts | 4 ++-- src/utils/rules-helpers.ts | 4 ++-- src/utils/string-helpers.spec.ts | 2 +- src/utils/test-helpers.ts | 2 +- src/utils/variable-helpers.spec.ts | 2 +- 54 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src/classes/logger.class.ts b/src/classes/logger.class.ts index 506a9d8..aa7d9bf 100644 --- a/src/classes/logger.class.ts +++ b/src/classes/logger.class.ts @@ -1,5 +1,5 @@ -import { ProblemStore } from "./problem-store.class.js"; -import { Problem } from "./problem.class.js"; +import { ProblemStore } from "./problem-store.class.ts"; +import { Problem } from "./problem.class.ts"; import terminalLink from "terminal-link"; import Table, { HorizontalTableRow, @@ -8,7 +8,7 @@ import Table, { Cell, } from "cli-table3"; import chalk from "chalk"; -import { SEVERITY_LEVEL } from "../constants.js"; +import { SEVERITY_LEVEL } from "../constants.ts"; class Logger { private problemStore: ProblemStore; diff --git a/src/classes/problem-store.class.ts b/src/classes/problem-store.class.ts index a416766..1596dfa 100644 --- a/src/classes/problem-store.class.ts +++ b/src/classes/problem-store.class.ts @@ -1,5 +1,5 @@ -import { RULE_TYPE, SEVERITY_LEVEL } from "../constants.js"; -import { Problem } from "../types.js"; +import { RULE_TYPE, SEVERITY_LEVEL } from "../constants.ts"; +import { Problem } from "../types.ts"; export class ProblemStore { // Validation Problems diff --git a/src/classes/problem.class.ts b/src/classes/problem.class.ts index e8ac6d6..40001e8 100644 --- a/src/classes/problem.class.ts +++ b/src/classes/problem.class.ts @@ -1,4 +1,4 @@ -import { RuleMeta, RuleSeverity } from "../types.js"; +import { RuleMeta, RuleSeverity } from "../types.ts"; class Problem { ruleMeta: RuleMeta; diff --git a/src/config/default-config.ts b/src/config/default-config.ts index 9610fd1..cdab9eb 100644 --- a/src/config/default-config.ts +++ b/src/config/default-config.ts @@ -1,4 +1,4 @@ -import { Config } from "../types.js"; +import { Config } from "../types.ts"; const config: Config = { defaultLocale: "", diff --git a/src/engine/rule-engine.ts b/src/engine/rule-engine.ts index fc4aa4e..5e29186 100644 --- a/src/engine/rule-engine.ts +++ b/src/engine/rule-engine.ts @@ -1,10 +1,10 @@ -import type { Config, Rule, TranslationFiles } from "../types.js"; -import * as rules from "../rules/index.js"; -import { ProblemStore } from "../classes/problem-store.class.js"; -import { getRuleIgnoreKeys, getRuleSeverity } from "../utils/rules-helpers.js"; -import { RULE_TYPE, SEVERITY_LEVEL } from "../constants.js"; -import { loadLanguageFiles } from "../utils/file-helpers.js"; -import { Logger } from "../classes/logger.class.js"; +import type { Config, Rule, TranslationFiles } from "../types.ts"; +import * as rules from "../rules/index.ts"; +import { ProblemStore } from "../classes/problem-store.class.ts"; +import { getRuleIgnoreKeys, getRuleSeverity } from "../utils/rules-helpers.ts"; +import { RULE_TYPE, SEVERITY_LEVEL } from "../constants.ts"; +import { loadLanguageFiles } from "../utils/file-helpers.ts"; +import { Logger } from "../classes/logger.class.ts"; function runRules(config: Config) { const problemStore = new ProblemStore(); diff --git a/src/index.ts b/src/index.ts index 3774692..b8b8dc7 100755 --- a/src/index.ts +++ b/src/index.ts @@ -4,9 +4,9 @@ import fs from "node:fs"; import path from "node:path"; import chalk from "chalk"; -import { runRules } from "./engine/rule-engine.js"; -import type { Config } from "./types.js"; -import { config } from "./config/default-config.js"; +import { runRules } from "./engine/rule-engine.ts"; +import type { Config } from "./types.ts"; +import { config } from "./config/default-config.ts"; const defaultConfig: Config = config; diff --git a/src/rules/index.ts b/src/rules/index.ts index 869b319..b6f132e 100644 --- a/src/rules/index.ts +++ b/src/rules/index.ts @@ -1,12 +1,12 @@ -import { noEmptyMessages } from "./no-empty-messages/no-empty-messages.js"; -import { noUntranslatedMessages } from "./no-untranslated-messages/index.js"; -import { noInvalidVariables } from "./no-invalid-variables/index.js"; -import { noHtmlMessages } from "./no-html-messages/index.js"; -import { noInvalidConfiguration } from "./no-invalid-configuration/index.js"; -import { noMissingKeys } from "./no-missing-keys/index.js"; -import { noInvalidSeverity } from "./no-invalid-severity/index.js"; -import { noMalformedKeys } from "./no-malformed-keys/index.js"; -import { noExtraWhitespace } from "./no-extra-whitespace/index.js"; +import { noEmptyMessages } from "./no-empty-messages/no-empty-messages.ts"; +import { noUntranslatedMessages } from "./no-untranslated-messages/index.ts"; +import { noInvalidVariables } from "./no-invalid-variables/index.ts"; +import { noHtmlMessages } from "./no-html-messages/index.ts"; +import { noInvalidConfiguration } from "./no-invalid-configuration/index.ts"; +import { noMissingKeys } from "./no-missing-keys/index.ts"; +import { noInvalidSeverity } from "./no-invalid-severity/index.ts"; +import { noMalformedKeys } from "./no-malformed-keys/index.ts"; +import { noExtraWhitespace } from "./no-extra-whitespace/index.ts"; export { noInvalidConfiguration, diff --git a/src/rules/no-empty-messages/index.ts b/src/rules/no-empty-messages/index.ts index 9c50e13..6fb8118 100644 --- a/src/rules/no-empty-messages/index.ts +++ b/src/rules/no-empty-messages/index.ts @@ -1 +1 @@ -export { noEmptyMessages } from "./no-empty-messages.js"; +export { noEmptyMessages } from "./no-empty-messages.ts"; diff --git a/src/rules/no-empty-messages/no-empty-messages.spec.ts b/src/rules/no-empty-messages/no-empty-messages.spec.ts index 03b72f9..562607d 100644 --- a/src/rules/no-empty-messages/no-empty-messages.spec.ts +++ b/src/rules/no-empty-messages/no-empty-messages.spec.ts @@ -1,15 +1,15 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noEmptyMessages } from "./no-empty-messages.js"; +} from "../../types.ts"; +import { noEmptyMessages } from "./no-empty-messages.ts"; import { getEmptySourceMessageProblem, getEmptyTranslatedMessageProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta = noEmptyMessages.meta; const rule = noEmptyMessages; diff --git a/src/rules/no-empty-messages/no-empty-messages.ts b/src/rules/no-empty-messages/no-empty-messages.ts index b82db5d..4f440c1 100644 --- a/src/rules/no-empty-messages/no-empty-messages.ts +++ b/src/rules/no-empty-messages/no-empty-messages.ts @@ -1,15 +1,15 @@ -import { SEVERITY_LEVEL } from "../../constants.js"; +import { SEVERITY_LEVEL } from "../../constants.ts"; import { Config, Rule, RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; +} from "../../types.ts"; import { getEmptySourceMessageProblem, getEmptyTranslatedMessageProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-empty-messages", diff --git a/src/rules/no-empty-messages/problems.ts b/src/rules/no-empty-messages/problems.ts index 8795956..8eaf16b 100644 --- a/src/rules/no-empty-messages/problems.ts +++ b/src/rules/no-empty-messages/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { key: string; diff --git a/src/rules/no-extra-whitespace/index.ts b/src/rules/no-extra-whitespace/index.ts index d0561e3..ada33cf 100644 --- a/src/rules/no-extra-whitespace/index.ts +++ b/src/rules/no-extra-whitespace/index.ts @@ -1 +1 @@ -export { noExtraWhitespace } from "./no-extra-whitespace.js"; +export { noExtraWhitespace } from "./no-extra-whitespace.ts"; diff --git a/src/rules/no-extra-whitespace/no-extra-whitespace.spec.ts b/src/rules/no-extra-whitespace/no-extra-whitespace.spec.ts index 1248a2c..0e53ae5 100644 --- a/src/rules/no-extra-whitespace/no-extra-whitespace.spec.ts +++ b/src/rules/no-extra-whitespace/no-extra-whitespace.spec.ts @@ -1,12 +1,12 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noExtraWhitespace } from "./no-extra-whitespace.js"; -import { getExtraWhitespaceFoundInMessageProblem } from "./problems.js"; +} from "../../types.ts"; +import { noExtraWhitespace } from "./no-extra-whitespace.ts"; +import { getExtraWhitespaceFoundInMessageProblem } from "./problems.ts"; const ruleMeta = noExtraWhitespace.meta; const rule = noExtraWhitespace; diff --git a/src/rules/no-extra-whitespace/no-extra-whitespace.ts b/src/rules/no-extra-whitespace/no-extra-whitespace.ts index 7badcc6..15034bb 100644 --- a/src/rules/no-extra-whitespace/no-extra-whitespace.ts +++ b/src/rules/no-extra-whitespace/no-extra-whitespace.ts @@ -1,17 +1,17 @@ -import { SEVERITY_LEVEL } from "../../constants.js"; +import { SEVERITY_LEVEL } from "../../constants.ts"; import { Config, Rule, RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; +} from "../../types.ts"; import { stringHasExtraneousWhitespace, stringHasWhitespacePadding, -} from "../../utils/string-helpers.js"; +} from "../../utils/string-helpers.ts"; -import { getExtraWhitespaceFoundInMessageProblem } from "./problems.js"; +import { getExtraWhitespaceFoundInMessageProblem } from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-extra-whitespace", diff --git a/src/rules/no-extra-whitespace/problems.ts b/src/rules/no-extra-whitespace/problems.ts index 729bed0..6858ef7 100644 --- a/src/rules/no-extra-whitespace/problems.ts +++ b/src/rules/no-extra-whitespace/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { key: string; diff --git a/src/rules/no-html-messages/index.ts b/src/rules/no-html-messages/index.ts index d72f635..45b8190 100644 --- a/src/rules/no-html-messages/index.ts +++ b/src/rules/no-html-messages/index.ts @@ -1 +1 @@ -export { noHtmlMessages } from "./no-html-messages.js"; +export { noHtmlMessages } from "./no-html-messages.ts"; diff --git a/src/rules/no-html-messages/no-html-messages.spec.ts b/src/rules/no-html-messages/no-html-messages.spec.ts index dd9b0b4..08d6da9 100644 --- a/src/rules/no-html-messages/no-html-messages.spec.ts +++ b/src/rules/no-html-messages/no-html-messages.spec.ts @@ -1,12 +1,12 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noHtmlMessages } from "./no-html-messages.js"; -import { getHtmlFoundInMessageProblem } from "./problems.js"; +} from "../../types.ts"; +import { noHtmlMessages } from "./no-html-messages.ts"; +import { getHtmlFoundInMessageProblem } from "./problems.ts"; const ruleMeta = noHtmlMessages.meta; const rule = noHtmlMessages; diff --git a/src/rules/no-html-messages/no-html-messages.ts b/src/rules/no-html-messages/no-html-messages.ts index a7e4637..ec701b8 100644 --- a/src/rules/no-html-messages/no-html-messages.ts +++ b/src/rules/no-html-messages/no-html-messages.ts @@ -1,14 +1,14 @@ -import { SEVERITY_LEVEL } from "../../constants.js"; +import { SEVERITY_LEVEL } from "../../constants.ts"; import { Config, Rule, RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; -import { getMessageHasHtml } from "../../utils/message-helpers.js"; +} from "../../types.ts"; +import { getMessageHasHtml } from "../../utils/message-helpers.ts"; -import { getHtmlFoundInMessageProblem } from "./problems.js"; +import { getHtmlFoundInMessageProblem } from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-html-messages", diff --git a/src/rules/no-html-messages/problems.ts b/src/rules/no-html-messages/problems.ts index 4ef2acb..1277e16 100644 --- a/src/rules/no-html-messages/problems.ts +++ b/src/rules/no-html-messages/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { key: string; diff --git a/src/rules/no-invalid-configuration/index.ts b/src/rules/no-invalid-configuration/index.ts index 548f68f..642409a 100644 --- a/src/rules/no-invalid-configuration/index.ts +++ b/src/rules/no-invalid-configuration/index.ts @@ -1 +1 @@ -export { noInvalidConfiguration } from "./no-invalid-configuration.js"; +export { noInvalidConfiguration } from "./no-invalid-configuration.ts"; diff --git a/src/rules/no-invalid-configuration/no-invalid-configuration.spec.ts b/src/rules/no-invalid-configuration/no-invalid-configuration.spec.ts index 3c538cb..65f9e4a 100644 --- a/src/rules/no-invalid-configuration/no-invalid-configuration.spec.ts +++ b/src/rules/no-invalid-configuration/no-invalid-configuration.spec.ts @@ -1,11 +1,11 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noInvalidConfiguration } from "./no-invalid-configuration.js"; +} from "../../types.ts"; +import { noInvalidConfiguration } from "./no-invalid-configuration.ts"; import { getInvalidPathToTranslatedFilesProblem, getInvalidTranslationFilesProblem, @@ -13,7 +13,7 @@ import { getMissingSourceFileProblem, getUnConfigurableRuleFoundInConfigProblem, getUnknownRuleConfigurationProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta = noInvalidConfiguration.meta; const rule = noInvalidConfiguration; diff --git a/src/rules/no-invalid-configuration/no-invalid-configuration.ts b/src/rules/no-invalid-configuration/no-invalid-configuration.ts index 4ddb792..7ccc545 100644 --- a/src/rules/no-invalid-configuration/no-invalid-configuration.ts +++ b/src/rules/no-invalid-configuration/no-invalid-configuration.ts @@ -4,12 +4,12 @@ import { RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; -import { isEmptyString } from "../../utils/string-helpers.js"; +} from "../../types.ts"; +import { isEmptyString } from "../../utils/string-helpers.ts"; import { configurableRuleNames, unConfigurableRuleNames, -} from "../../constants.js"; +} from "../../constants.ts"; import { getInvalidTranslationFilesProblem, getMissingSourceFileProblem, @@ -17,7 +17,7 @@ import { getInvalidPathToTranslatedFilesProblem, getUnknownRuleConfigurationProblem, getUnConfigurableRuleFoundInConfigProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-invalid-configuration", diff --git a/src/rules/no-invalid-configuration/problems.ts b/src/rules/no-invalid-configuration/problems.ts index 3530f80..f79e0e0 100644 --- a/src/rules/no-invalid-configuration/problems.ts +++ b/src/rules/no-invalid-configuration/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { severity: RuleSeverity; diff --git a/src/rules/no-invalid-severity/index.ts b/src/rules/no-invalid-severity/index.ts index aa288c1..f0c8732 100644 --- a/src/rules/no-invalid-severity/index.ts +++ b/src/rules/no-invalid-severity/index.ts @@ -1 +1 @@ -export { noInvalidSeverity } from "./no-invalid-severity.js"; +export { noInvalidSeverity } from "./no-invalid-severity.ts"; diff --git a/src/rules/no-invalid-severity/no-invalid-severity.spec.ts b/src/rules/no-invalid-severity/no-invalid-severity.spec.ts index da886ad..9acbe77 100644 --- a/src/rules/no-invalid-severity/no-invalid-severity.spec.ts +++ b/src/rules/no-invalid-severity/no-invalid-severity.spec.ts @@ -1,12 +1,12 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noInvalidSeverity } from "./no-invalid-severity.js"; -import { getInvalidSeverityProblem } from "./problems.js"; +} from "../../types.ts"; +import { noInvalidSeverity } from "./no-invalid-severity.ts"; +import { getInvalidSeverityProblem } from "./problems.ts"; const ruleMeta = noInvalidSeverity.meta; const rule = noInvalidSeverity; diff --git a/src/rules/no-invalid-severity/no-invalid-severity.ts b/src/rules/no-invalid-severity/no-invalid-severity.ts index f62dcd7..52667cb 100644 --- a/src/rules/no-invalid-severity/no-invalid-severity.ts +++ b/src/rules/no-invalid-severity/no-invalid-severity.ts @@ -1,12 +1,12 @@ -import { validSeverities } from "../../constants.js"; +import { validSeverities } from "../../constants.ts"; import { Config, Rule, RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; -import { getInvalidSeverityProblem } from "./problems.js"; +} from "../../types.ts"; +import { getInvalidSeverityProblem } from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-invalid-severity", diff --git a/src/rules/no-invalid-severity/problems.ts b/src/rules/no-invalid-severity/problems.ts index b3b9ab2..c1c5f1c 100644 --- a/src/rules/no-invalid-severity/problems.ts +++ b/src/rules/no-invalid-severity/problems.ts @@ -1,6 +1,6 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; -import { SEVERITY_LEVEL } from "../../constants.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; +import { SEVERITY_LEVEL } from "../../constants.ts"; const validSeverities = Object.values(SEVERITY_LEVEL); diff --git a/src/rules/no-invalid-variables/index.ts b/src/rules/no-invalid-variables/index.ts index 3dd62cf..e89e603 100644 --- a/src/rules/no-invalid-variables/index.ts +++ b/src/rules/no-invalid-variables/index.ts @@ -1 +1 @@ -export { noInvalidVariables } from "./no-invalid-variables.js"; +export { noInvalidVariables } from "./no-invalid-variables.ts"; diff --git a/src/rules/no-invalid-variables/no-invalid-variables.spec.ts b/src/rules/no-invalid-variables/no-invalid-variables.spec.ts index 2fa2d68..96bb4ba 100644 --- a/src/rules/no-invalid-variables/no-invalid-variables.spec.ts +++ b/src/rules/no-invalid-variables/no-invalid-variables.spec.ts @@ -1,17 +1,17 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noInvalidVariables } from "./no-invalid-variables.js"; +} from "../../types.ts"; +import { noInvalidVariables } from "./no-invalid-variables.ts"; import { getMismatchedVariableFromSourceProblem, getMissingVariableFromSourceProblem, getInvalidVariableSyntaxProblem, getUnbalancedVariableBracketsSyntaxProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta = noInvalidVariables.meta; const rule = noInvalidVariables; diff --git a/src/rules/no-invalid-variables/no-invalid-variables.ts b/src/rules/no-invalid-variables/no-invalid-variables.ts index 60ba7c8..0ce8098 100644 --- a/src/rules/no-invalid-variables/no-invalid-variables.ts +++ b/src/rules/no-invalid-variables/no-invalid-variables.ts @@ -1,22 +1,22 @@ -import { SEVERITY_LEVEL } from "../../constants.js"; +import { SEVERITY_LEVEL } from "../../constants.ts"; import { Config, Rule, RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; +} from "../../types.ts"; import { extractVariableNamesFromMessage, extractVariablesFromLocaleData, hasUnbalancedBrackets, -} from "../../utils/variable-helpers.js"; +} from "../../utils/variable-helpers.ts"; import { getMissingVariableFromSourceProblem, getMismatchedVariableFromSourceProblem, getInvalidVariableSyntaxProblem, getUnbalancedVariableBracketsSyntaxProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-invalid-variables", diff --git a/src/rules/no-invalid-variables/problems.ts b/src/rules/no-invalid-variables/problems.ts index 07e1f57..f4b2843 100644 --- a/src/rules/no-invalid-variables/problems.ts +++ b/src/rules/no-invalid-variables/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { key: string; diff --git a/src/rules/no-malformed-keys/index.ts b/src/rules/no-malformed-keys/index.ts index c7f2eb9..304fe16 100644 --- a/src/rules/no-malformed-keys/index.ts +++ b/src/rules/no-malformed-keys/index.ts @@ -1 +1 @@ -export { noMalformedKeys } from "./no-malformed-keys.js"; +export { noMalformedKeys } from "./no-malformed-keys.ts"; diff --git a/src/rules/no-malformed-keys/no-malformed-keys.spec.ts b/src/rules/no-malformed-keys/no-malformed-keys.spec.ts index 9adc234..c2e5722 100644 --- a/src/rules/no-malformed-keys/no-malformed-keys.spec.ts +++ b/src/rules/no-malformed-keys/no-malformed-keys.spec.ts @@ -1,12 +1,12 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noMalformedKeys } from "./no-malformed-keys.js"; -import { getMalformedKeyFoundProblem } from "./problems.js"; +} from "../../types.ts"; +import { noMalformedKeys } from "./no-malformed-keys.ts"; +import { getMalformedKeyFoundProblem } from "./problems.ts"; const ruleMeta = noMalformedKeys.meta; const rule = noMalformedKeys; diff --git a/src/rules/no-malformed-keys/no-malformed-keys.ts b/src/rules/no-malformed-keys/no-malformed-keys.ts index cabe1f9..f26787f 100644 --- a/src/rules/no-malformed-keys/no-malformed-keys.ts +++ b/src/rules/no-malformed-keys/no-malformed-keys.ts @@ -1,4 +1,4 @@ -import { SEVERITY_LEVEL, keyNamingConventions } from "../../constants.js"; +import { SEVERITY_LEVEL, keyNamingConventions } from "../../constants.ts"; import { Config, Rule, @@ -6,14 +6,14 @@ import { RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; +} from "../../types.ts"; import { isCamelCase, isKebabCase, isPascalCase, isSnakeCase, -} from "../../utils/string-helpers.js"; -import { getMalformedKeyFoundProblem } from "./problems.js"; +} from "../../utils/string-helpers.ts"; +import { getMalformedKeyFoundProblem } from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-malformed-keys", diff --git a/src/rules/no-malformed-keys/problems.ts b/src/rules/no-malformed-keys/problems.ts index 0fb3317..9106442 100644 --- a/src/rules/no-malformed-keys/problems.ts +++ b/src/rules/no-malformed-keys/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { key: string; diff --git a/src/rules/no-missing-keys/index.ts b/src/rules/no-missing-keys/index.ts index 3e65507..e0860e4 100644 --- a/src/rules/no-missing-keys/index.ts +++ b/src/rules/no-missing-keys/index.ts @@ -1 +1 @@ -export { noMissingKeys } from "./no-missing-keys.js"; +export { noMissingKeys } from "./no-missing-keys.ts"; diff --git a/src/rules/no-missing-keys/no-missing-keys.spec.ts b/src/rules/no-missing-keys/no-missing-keys.spec.ts index adc4595..0b12c73 100644 --- a/src/rules/no-missing-keys/no-missing-keys.spec.ts +++ b/src/rules/no-missing-keys/no-missing-keys.spec.ts @@ -1,15 +1,15 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noMissingKeys } from "./no-missing-keys.js"; +} from "../../types.ts"; +import { noMissingKeys } from "./no-missing-keys.ts"; import { getMissingExpectedKeyFoundProblem, getUnexpectedKeyFoundProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta = noMissingKeys.meta; const rule = noMissingKeys; diff --git a/src/rules/no-missing-keys/no-missing-keys.ts b/src/rules/no-missing-keys/no-missing-keys.ts index 081689d..c1d77b2 100644 --- a/src/rules/no-missing-keys/no-missing-keys.ts +++ b/src/rules/no-missing-keys/no-missing-keys.ts @@ -1,15 +1,15 @@ -import { SEVERITY_LEVEL } from "../../constants.js"; +import { SEVERITY_LEVEL } from "../../constants.ts"; import { Config, Rule, RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; +} from "../../types.ts"; import { getUnexpectedKeyFoundProblem, getMissingExpectedKeyFoundProblem, -} from "./problems.js"; +} from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-missing-keys", diff --git a/src/rules/no-missing-keys/problems.ts b/src/rules/no-missing-keys/problems.ts index 33bbbac..4829d1c 100644 --- a/src/rules/no-missing-keys/problems.ts +++ b/src/rules/no-missing-keys/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { key: string; diff --git a/src/rules/no-untranslated-messages/index.ts b/src/rules/no-untranslated-messages/index.ts index b4a9b40..54a6a79 100644 --- a/src/rules/no-untranslated-messages/index.ts +++ b/src/rules/no-untranslated-messages/index.ts @@ -1 +1 @@ -export { noUntranslatedMessages } from "./no-untranslated-messages.js"; +export { noUntranslatedMessages } from "./no-untranslated-messages.ts"; diff --git a/src/rules/no-untranslated-messages/no-untranslated-messages.spec.ts b/src/rules/no-untranslated-messages/no-untranslated-messages.spec.ts index a0d6172..388eb6f 100644 --- a/src/rules/no-untranslated-messages/no-untranslated-messages.spec.ts +++ b/src/rules/no-untranslated-messages/no-untranslated-messages.spec.ts @@ -1,12 +1,12 @@ -import { createMockProblemReporter } from "../../utils/test-helpers.js"; +import { createMockProblemReporter } from "../../utils/test-helpers.ts"; import { Config, RuleContext, RuleSeverity, TranslationFiles, -} from "../../types.js"; -import { noUntranslatedMessages } from "./no-untranslated-messages.js"; -import { getUntranslatedMessageProblem } from "./problems.js"; +} from "../../types.ts"; +import { noUntranslatedMessages } from "./no-untranslated-messages.ts"; +import { getUntranslatedMessageProblem } from "./problems.ts"; const ruleMeta = noUntranslatedMessages.meta; const rule = noUntranslatedMessages; diff --git a/src/rules/no-untranslated-messages/no-untranslated-messages.ts b/src/rules/no-untranslated-messages/no-untranslated-messages.ts index 024c0eb..24e7047 100644 --- a/src/rules/no-untranslated-messages/no-untranslated-messages.ts +++ b/src/rules/no-untranslated-messages/no-untranslated-messages.ts @@ -1,12 +1,12 @@ -import { SEVERITY_LEVEL } from "../../constants.js"; +import { SEVERITY_LEVEL } from "../../constants.ts"; import { Config, Rule, RuleContext, RuleMeta, TranslationFiles, -} from "../../types.js"; -import { getUntranslatedMessageProblem } from "./problems.js"; +} from "../../types.ts"; +import { getUntranslatedMessageProblem } from "./problems.ts"; const ruleMeta: RuleMeta = { name: "no-untranslated-messages", diff --git a/src/rules/no-untranslated-messages/problems.ts b/src/rules/no-untranslated-messages/problems.ts index 7905945..ff5c3c2 100644 --- a/src/rules/no-untranslated-messages/problems.ts +++ b/src/rules/no-untranslated-messages/problems.ts @@ -1,5 +1,5 @@ -import { Problem } from "../../classes/problem.class.js"; -import { RuleMeta, RuleSeverity } from "../../types.js"; +import { Problem } from "../../classes/problem.class.ts"; +import { RuleMeta, RuleSeverity } from "../../types.ts"; type ProblemContext = { key: string; diff --git a/src/types.ts b/src/types.ts index 7b6d9d7..ba7d037 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ -import { ProblemStore } from "./classes/problem-store.class.js"; -import { SEVERITY_LEVEL, RULE_TYPE } from "./constants.js"; +import { ProblemStore } from "./classes/problem-store.class.ts"; +import { SEVERITY_LEVEL, RULE_TYPE } from "./constants.ts"; export type RuleSeverity = keyof typeof SEVERITY_LEVEL; export type RuleAdvancedConfig = { diff --git a/src/utils/config-helpers.spec.ts b/src/utils/config-helpers.spec.ts index afd9114..3f133c4 100644 --- a/src/utils/config-helpers.spec.ts +++ b/src/utils/config-helpers.spec.ts @@ -1,6 +1,6 @@ -import type { Config } from "../types.js"; +import type { Config } from "../types.ts"; -import { getAllSupportedLocales } from "./config-helpers.js"; +import { getAllSupportedLocales } from "./config-helpers.ts"; describe("getAllSupportedLocales", () => { it("should get all supported locales", () => { diff --git a/src/utils/config-helpers.ts b/src/utils/config-helpers.ts index af831a4..7581e3b 100644 --- a/src/utils/config-helpers.ts +++ b/src/utils/config-helpers.ts @@ -1,4 +1,4 @@ -import type { Config } from "../types.js"; +import type { Config } from "../types.ts"; export function getAllSupportedLocales(config: Config): string[] { const allSupportedLocales = new Set([ diff --git a/src/utils/file-helpers.spec.ts b/src/utils/file-helpers.spec.ts index 50dbb18..3da2b70 100644 --- a/src/utils/file-helpers.spec.ts +++ b/src/utils/file-helpers.spec.ts @@ -1,5 +1,5 @@ -import type { TranslationFiles } from "../types.js"; -import { flatten } from "./file-helpers.js"; +import type { TranslationFiles } from "../types.ts"; +import { flatten } from "./file-helpers.ts"; describe("flatten", () => { it("should flatten nested JavaScript objects", () => { diff --git a/src/utils/file-helpers.ts b/src/utils/file-helpers.ts index 62dd2c3..a5f284a 100644 --- a/src/utils/file-helpers.ts +++ b/src/utils/file-helpers.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "node:fs"; import { flattie } from "flattie"; -import type { Config, TranslationFiles } from "../types.js"; +import type { Config, TranslationFiles } from "../types.ts"; export function flatten(obj: TranslationFiles): Record { return flattie(obj, "."); diff --git a/src/utils/message-helpers.spec.ts b/src/utils/message-helpers.spec.ts index 1ac330f..fa356a6 100644 --- a/src/utils/message-helpers.spec.ts +++ b/src/utils/message-helpers.spec.ts @@ -1,4 +1,4 @@ -import { getMessageHasHtml } from "./message-helpers.js"; +import { getMessageHasHtml } from "./message-helpers.ts"; describe("getMessageHasHtml", () => { it("should return true for simple HTML tags", () => { diff --git a/src/utils/rules-helpers.spec.ts b/src/utils/rules-helpers.spec.ts index b7fe755..df3f4b3 100644 --- a/src/utils/rules-helpers.spec.ts +++ b/src/utils/rules-helpers.spec.ts @@ -1,5 +1,5 @@ -import type { Config, Rule, RuleMeta } from "../types.js"; -import { getRuleSeverity, getRuleIgnoreKeys } from "./rules-helpers.js"; +import type { Config, Rule, RuleMeta } from "../types.ts"; +import { getRuleSeverity, getRuleIgnoreKeys } from "./rules-helpers.ts"; describe("getRuleSeverity", () => { it("should get ruleMeta.defaultSeverity if none is supplied", () => { diff --git a/src/utils/rules-helpers.ts b/src/utils/rules-helpers.ts index c9ef7d9..63004a9 100644 --- a/src/utils/rules-helpers.ts +++ b/src/utils/rules-helpers.ts @@ -1,5 +1,5 @@ -import { validSeverities } from "../constants.js"; -import type { Config, Rule, RuleSeverity } from "../types.js"; +import { validSeverities } from "../constants.ts"; +import type { Config, Rule, RuleSeverity } from "../types.ts"; /** * Get the user-supplied (or default) configured severity of a specific rule. diff --git a/src/utils/string-helpers.spec.ts b/src/utils/string-helpers.spec.ts index aa7beed..2f082fa 100644 --- a/src/utils/string-helpers.spec.ts +++ b/src/utils/string-helpers.spec.ts @@ -6,7 +6,7 @@ import { isKebabCase, stringHasWhitespacePadding, stringHasExtraneousWhitespace, -} from "./string-helpers.js"; +} from "./string-helpers.ts"; describe("isEmptyString", () => { it("should return true for empty strings", () => { diff --git a/src/utils/test-helpers.ts b/src/utils/test-helpers.ts index 2970a27..14b9993 100644 --- a/src/utils/test-helpers.ts +++ b/src/utils/test-helpers.ts @@ -1,4 +1,4 @@ -import { ProblemStore } from "../classes/problem-store.class.js"; +import { ProblemStore } from "../classes/problem-store.class.ts"; export const createMockProblemReporter = () => { return { diff --git a/src/utils/variable-helpers.spec.ts b/src/utils/variable-helpers.spec.ts index ad32ab9..2ebd805 100644 --- a/src/utils/variable-helpers.spec.ts +++ b/src/utils/variable-helpers.spec.ts @@ -1,4 +1,4 @@ -import { hasUnbalancedBrackets } from "./variable-helpers.js"; +import { hasUnbalancedBrackets } from "./variable-helpers.ts"; describe("hasUnbalancedBrackets", () => { it("should return true for strings with unbalanced brackets", () => {