Skip to content

Commit

Permalink
Merge pull request #166 from burashka/fix-lint-warning
Browse files Browse the repository at this point in the history
fix: Fix linters warnings
  • Loading branch information
burashka authored Aug 24, 2022
2 parents a4403f4 + b5b1909 commit d6dff0b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/resolvers/md2md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export async function resolveMd2Md(options: ResolveMd2MdOptions): Promise<string

writeFileSync(outputPath, result);
logger.info(inputPath, PROCESSING_FINISHED);

return undefined;
}

function copyFile(targetPath: string, targetDestPath: string, options?: PluginOptions) {
Expand Down
6 changes: 5 additions & 1 deletion src/services/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ function matchMetadata(fileContent: string) {
return regexpParseFileContent.exec(fileContent);
}

async function getContributorsMetadataString(options: MetaDataOptions, fileContent: string): Promise<string | undefined> {
async function getContributorsMetadataString(
options: MetaDataOptions, fileContent: string,
): Promise<string | undefined> {
const {isContributorsEnabled, vcsConnector, fileData} = options;

if (isContributorsEnabled && vcsConnector) {
Expand All @@ -117,6 +119,8 @@ async function getContributorsMetadataString(options: MetaDataOptions, fileConte

return getFileContributorsMetadata(updatedFileData, vcsConnector);
}

return undefined;
}

function getUpdatedMetadataString(newMetadatas: string[], defaultMetadata = ''): string {
Expand Down
1 change: 1 addition & 0 deletions src/services/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@ export function getDefaultLintConfig(): LintConfig | undefined {

// https://github.com/webpack/webpack/issues/4175#issuecomment-323023911
function requireDynamically(path: string) {
// eslint-disable-next-line no-eval
return eval(`require('${path}');`); // Ensure Webpack does not analyze the require statement
}
4 changes: 3 additions & 1 deletion src/services/tocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ function _replaceIncludes(items: YfmToc[], tocDir: string, sourcesDir: string, v
includedInlineItems = includedTocItems;
}
} catch (err) {
const message = `Error while including toc: ${bold(includeTocPath)} to ${bold(join(tocDir, 'toc.yaml'))}`;
const message = (
`Error while including toc: ${bold(includeTocPath)} to ${bold(join(tocDir, 'toc.yaml'))}`
);
console.log(message, err);
log.error(message);
return acc;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/markup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ function getMetadata(metadata: Record<string, string>): string {
.join('\n');
}

export const сarriage = platform === Platforms.WINDOWS ? '\r\n' : '\n';

export function joinSinglePageResults(singlePageResults: SinglePageResult[]): string {
const delimeter = `${сarriage}${сarriage}<hr class="yfm-page__delimeter">${сarriage}${сarriage}`;
return singlePageResults
Expand All @@ -82,5 +84,3 @@ export function joinSinglePageResults(singlePageResults: SinglePageResult[]): st
export function replaceDoubleToSingleQuotes(str: string): string {
return str.replace(/"/g, '\'');
}

export const сarriage = platform === Platforms.WINDOWS ? '\r\n' : '\n';

0 comments on commit d6dff0b

Please sign in to comment.