1
0
mirror of synced 2026-01-20 21:02:43 -05:00

trailingCommas:all on prettier (#38888)

This commit is contained in:
Peter Bengtsson
2023-07-11 07:44:52 -04:00
committed by GitHub
parent 3e6c8c2900
commit 2ec905fc77
290 changed files with 908 additions and 898 deletions

View File

@@ -10,7 +10,7 @@ import { remove } from 'unist-util-remove'
import { languageKeys } from '../../../lib/languages.js'
const { targetDirectory, removeKeywords } = JSON.parse(
await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8')
await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'),
)
const RELATIVE_LINK_PATH = targetDirectory.replace('content', '')
const LAST_PRIMARY_HEADING = 'Options'
@@ -141,7 +141,7 @@ export async function convertContentToDocs(content, frontmatterDefaults = {}) {
if (node.type === 'text' && node.value.includes('{.interpreted-text')) {
const paragraph = ancestors[ancestors.length - 1].children
const docRoleTagChild = paragraph.findIndex(
(child) => child.value && child.value.includes('{.interpreted-text')
(child) => child.value && child.value.includes('{.interpreted-text'),
)
const link = paragraph[docRoleTagChild - 1]
// If child node is already a link node, skip it
@@ -153,7 +153,7 @@ export async function convertContentToDocs(content, frontmatterDefaults = {}) {
// rule, we may need to modify this code to handle it.
if (link.type !== 'inlineCode') {
throw new Error(
'Unexpected node type. The node before a text node with {.interpreted-text role="doc"} should be an inline code or link node.'
'Unexpected node type. The node before a text node with {.interpreted-text role="doc"} should be an inline code or link node.',
)
}
@@ -209,7 +209,7 @@ export async function convertContentToDocs(content, frontmatterDefaults = {}) {
// rewrite the aka.ms link
node.children[0].value = 'AUTOTITLE'
node.url = url
})
}),
)
// remove the program section from the AST

View File

@@ -13,7 +13,7 @@ import { updateContentDirectory } from '../../automated-pipelines/lib/update-mar
import { convertContentToDocs } from './convert-markdown-for-docs.js'
const { targetDirectory, sourceDirectory, frontmatterDefaults, markdownPrefix } = JSON.parse(
await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8')
await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'),
)
const SOURCE_REPO = sourceDirectory.split('/')[0]
const TEMP_DIRECTORY = path.join(SOURCE_REPO, 'tempCliDocs')
@@ -59,7 +59,7 @@ async function setupEnvironment() {
const isPandoc = execSync('pandoc --version', { encoding: 'utf8' })
if (!isPandoc.startsWith('pandoc')) {
throw new Error(
'You must install pandoc to run this script. See https://pandoc.org/installing.html.'
'You must install pandoc to run this script. See https://pandoc.org/installing.html.',
)
}