Skip to content

Commit

Permalink
chore: fix docs tool lint issues (#13046)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Dec 10, 2021
1 parent bdbcd61 commit f44f244
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/docs/presets.ts
Expand Up @@ -34,7 +34,7 @@ export async function generatePresets(dist: string): Promise<void> {
let content = `\n`;
for (const [preset, value] of Object.entries(presetConfig)) {
let header = `\n### ${name === 'default' ? '' : name}:${preset}`;
let presetDescription = value.description;
let presetDescription = value.description as string;
delete value.description;
if (!presetDescription) {
if (value.packageRules?.[0].description) {
Expand Down
12 changes: 11 additions & 1 deletion tools/docs/versioning.ts
Expand Up @@ -2,14 +2,24 @@ import { getVersioningList } from '../../lib/versioning';
import { readFile, updateFile } from '../utils';
import { formatDescription, formatUrls, replaceContent } from './utils';

type Versioning = {
id: string;
displayName: string;
urls?: string[];
supportsRanges?: boolean;
supportedRangeStrategies?: string[];
};

export async function generateVersioning(dist: string): Promise<void> {
const versioningList = getVersioningList();
let versioningContent =
'\nSupported values for `versioning` are: ' +
versioningList.map((v) => `\`${v}\``).join(', ') +
'.\n\n';
for (const versioning of versioningList) {
const definition = await import(`../../lib/versioning/${versioning}`);
const definition = (await import(
`../../lib/versioning/${versioning}`
)) as Versioning;
const { id, displayName, urls, supportsRanges, supportedRangeStrategies } =
definition;
versioningContent += `\n### ${displayName} Versioning\n\n`;
Expand Down

0 comments on commit f44f244

Please sign in to comment.