Skip to content

Commit

Permalink
Merge pull request #30 from radiovisual/update-imports
Browse files Browse the repository at this point in the history
chore: update imports
  • Loading branch information
radiovisual authored Sep 25, 2024
2 parents 4071a41 + 6b644cc commit b73f919
Show file tree
Hide file tree
Showing 27 changed files with 42 additions and 42 deletions.
10 changes: 5 additions & 5 deletions src/engine/rule-engine.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import chalk from "chalk";
import type { Config, Rule, TranslationFiles } from "../types";
import type { Config, Rule, TranslationFiles } from "../types.ts";
import * as rules from "../rules/index.js";
import { ProblemStore } from "../classes/problem-store.class.js";
import { getRuleIgnoreKeys, getRuleSeverity } from "../utils/rules-helpers";
import { RULE_TYPE, SEVERITY_LEVEL } from "../constants";
import { loadLanguageFiles } from "../utils/file-helpers";
import { Logger } from "../classes/logger.class";
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();
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-extra-whitespace/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { noExtraWhitespace } from "./no-extra-whitespace";
export { noExtraWhitespace } from "./no-extra-whitespace.ts";
4 changes: 2 additions & 2 deletions src/rules/no-extra-whitespace/problems.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Problem } from "../../classes/problem.class";
import { RuleMeta, RuleSeverity } from "../../types";
import { Problem } from "../../classes/problem.class.ts";
import { RuleMeta, RuleSeverity } from "../../types.ts";

type ProblemContext = {
key: string;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-html-messages/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { noHtmlMessages } from "./no-html-messages";
export { noHtmlMessages } from "./no-html-messages.ts";
4 changes: 2 additions & 2 deletions src/rules/no-html-messages/problems.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Problem } from "../../classes/problem.class";
import { RuleMeta, RuleSeverity } from "../../types";
import { Problem } from "../../classes/problem.class.ts";
import { RuleMeta, RuleSeverity } from "../../types.ts";

type ProblemContext = {
key: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createMockProblemReporter } from "../../utils/test-helpers";
import { createMockProblemReporter } from "../../utils/test-helpers.ts";
import {
Config,
RuleContext,
RuleSeverity,
TranslationFiles,
} from "../../types.ts";
import { noInvalidConfiguration } from "./no-invalid-configuration";
import { noInvalidConfiguration } from "./no-invalid-configuration.ts";
import {
getInvalidPathToTranslatedFilesProblem,
getInvalidTranslationFilesProblem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isEmptyString } from "../../utils/string-helpers.ts";
import {
configurableRuleNames,
unConfigurableRuleNames,
} from "../../constants";
} from "../../constants.ts";
import {
getInvalidTranslationFilesProblem,
getMissingSourceFileProblem,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-invalid-variables/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { noInvalidVariables } from "./no-invalid-variables";
export { noInvalidVariables } from "./no-invalid-variables.ts";
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
RuleSeverity,
TranslationFiles,
} from "../../types.js";
import { noInvalidVariables } from "./no-invalid-variables";
import { noInvalidVariables } from "./no-invalid-variables.ts";
import {
getMismatchedVariableFromSourceProblem,
getMissingVariableFromSourceProblem,
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no-invalid-variables/problems.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Problem } from "../../classes/problem.class";
import { RuleMeta, RuleSeverity } from "../../types";
import { Problem } from "../../classes/problem.class.ts";
import { RuleMeta, RuleSeverity } from "../../types.ts";

type ProblemContext = {
key: string;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-malformed-keys/custom-key-name-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// validation function to the no-malformed-keys.validationFunctionPath option
module.exports = (key) => {
return false;
}
};
2 changes: 1 addition & 1 deletion src/rules/no-malformed-keys/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { noMalformedKeys } from "./no-malformed-keys";
export { noMalformedKeys } from "./no-malformed-keys.ts";
2 changes: 1 addition & 1 deletion src/rules/no-malformed-keys/no-malformed-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const noMalformedKeys: Rule = {
// Check if the user provided their own validation function. If supplied.
// this user-supplied validation function will be the only validation function that we run.
// At this point, Keeli is already running, so we can assume the provided function
// is valid, otherwise the problem would have ben caught when the configuration rules run.
// is valid, otherwise the problem would have been caught when the configuration rules run.
if (validationFunctionPath) {
// Load the function at the provided validationFunctionPath
validationFunction = require(validationFunctionPath);
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no-malformed-keys/problems.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Problem } from "../../classes/problem.class";
import { RuleMeta, RuleSeverity } from "../../types";
import { Problem } from "../../classes/problem.class.ts";
import { RuleMeta, RuleSeverity } from "../../types.ts";

type ProblemContext = {
key: string;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-missing-keys/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { noMissingKeys } from "./no-missing-keys";
export { noMissingKeys } from "./no-missing-keys.ts";
4 changes: 2 additions & 2 deletions src/rules/no-missing-keys/problems.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Problem } from "../../classes/problem.class";
import { RuleMeta, RuleSeverity } from "../../types";
import { Problem } from "../../classes/problem.class.ts";
import { RuleMeta, RuleSeverity } from "../../types.ts";

type ProblemContext = {
key: string;
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no-untranslated-messages/problems.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Problem } from "../../classes/problem.class";
import { RuleMeta, RuleSeverity } from "../../types";
import { Problem } from "../../classes/problem.class.ts";
import { RuleMeta, RuleSeverity } from "../../types.ts";

type ProblemContext = {
key: string;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/config-helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Config } from "../types";
import type { Config } from "../types.ts";

import { getAllSupportedLocales } from "./config-helpers";
import { getAllSupportedLocales } from "./config-helpers.ts";

describe("getAllSupportedLocales", () => {
it("should get all supported locales", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Config } from "../types";
import type { Config } from "../types.ts";

export function getAllSupportedLocales(config: Config): string[] {
const allSupportedLocales = new Set([
Expand Down
4 changes: 2 additions & 2 deletions src/utils/file-helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TranslationFiles } from "../types";
import { flatten } from "./file-helpers";
import type { TranslationFiles } from "../types.ts";
import { flatten } from "./file-helpers.ts";

describe("flatten", () => {
it("should flatten nested JavaScript objects", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/file-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";
import fs from "node:fs";
import { flattie } from "flattie";
import type { Config, TranslationFiles } from "../types";
import type { Config, TranslationFiles } from "../types.ts";

export function flatten(obj: TranslationFiles): Record<string, string> {
return flattie(obj, ".");
Expand Down
2 changes: 1 addition & 1 deletion src/utils/message-helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMessageHasHtml } from "./message-helpers";
import { getMessageHasHtml } from "./message-helpers.ts";

describe("getMessageHasHtml", () => {
it("should return true for simple HTML tags", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/rules-helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config, Rule, RuleSeverity, RuleMeta } from "../types";
import { getRuleSeverity, getRuleIgnoreKeys } from "./rules-helpers";
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", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/rules-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { validSeverities } from "../constants";
import type { Config, Rule, RuleSeverity } from "../types";
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.
Expand Down
2 changes: 1 addition & 1 deletion src/utils/string-helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
isKebabCase,
stringHasWhitespacePadding,
stringHasExtraneousWhitespace,
} from "./string-helpers";
} from "./string-helpers.ts";

describe("isEmptyString", () => {
it("should return true for empty strings", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/test-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProblemStore } from "../classes/problem-store.class";
import { ProblemStore } from "../classes/problem-store.class.ts";

export const createMockProblemReporter = () => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/variable-helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasUnbalancedBrackets } from "./variable-helpers";
import { hasUnbalancedBrackets } from "./variable-helpers.ts";

describe("hasUnbalancedBrackets", () => {
it("should return true for strings with unbalanced brackets", () => {
Expand Down

0 comments on commit b73f919

Please sign in to comment.