Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
makamekm committed Apr 1, 2024
1 parent f0a9a8d commit 286fb30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
14 changes: 4 additions & 10 deletions src/steps/processPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
SINGLE_PAGE_DATA_FILENAME,
SINGLE_PAGE_FILENAME,
} from '../constants';
import { generateStaticRedirect } from '../utils/redirect';
import {generateStaticRedirect} from '../utils/redirect';

const singlePageResults: Record<string, SinglePageResult[]> = {};
const singlePagePaths: Record<string, Set<string>> = {};
Expand Down Expand Up @@ -186,19 +186,13 @@ async function saveSinglePages(outputBundlePath: string) {
}
}

function saveRedirectPage(pathData: {
outputBundlePath: string;
outputDir: string;
}): void {
const {
output: outputFolderPath,
lang,
} = ArgvService.getConfig();
function saveRedirectPage(pathData: {outputBundlePath: string; outputDir: string}): void {
const {output: outputFolderPath, lang} = ArgvService.getConfig();

const {outputBundlePath, outputDir} = pathData;

const relativeOutputBundlePath = relative(outputFolderPath, outputBundlePath);
const redirectPagePath = join(outputDir, "index.html");
const redirectPagePath = join(outputDir, 'index.html');
const content = generateStaticRedirect(lang || Lang.RU, relativeOutputBundlePath);

writeFileSync(redirectPagePath, content);
Expand Down
5 changes: 1 addition & 4 deletions src/utils/redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import {PluginService} from '../services';
import {join} from 'path';
import manifest from '@diplodoc/client/manifest';

export function generateStaticRedirect(
lang: Lang,
pathToBundle: string,
): string {
export function generateStaticRedirect(lang: Lang, pathToBundle: string): string {
const isRTL = RTL_LANGS.includes(lang);

return `
Expand Down

0 comments on commit 286fb30

Please sign in to comment.