1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Remove disabling of prefer-template eslint rule (#58230)

This commit is contained in:
Kevin Heis
2025-10-30 09:24:12 -07:00
committed by GitHub
parent 4f46d28722
commit 7d1a209660
72 changed files with 234 additions and 250 deletions

View File

@@ -18,7 +18,7 @@ interface OcticonsMatch {
}
const OptionsSyntax = /([a-zA-Z-]+)="([\w\s-]+)"*/g
const Syntax = new RegExp('"(?<icon>[a-zA-Z-]+)"(?<options>(?:\\s' + OptionsSyntax.source + ')*)')
const Syntax = new RegExp(`"(?<icon>[a-zA-Z-]+)"(?<options>(?:\\s${OptionsSyntax.source})*)`)
const SyntaxHelp = 'Syntax Error in tag \'octicon\' - Valid syntax: octicon "<name>" <key="value">'
/**

View File

@@ -268,7 +268,7 @@ function makeHref(root, filePath) {
} else {
nameSplit.push(nameSplit.pop().replace(/\.md$/, ''))
}
return '/' + nameSplit.join('/')
return `/${nameSplit.join('/')}`
}
function moveFolder(oldPath, newPath, files, opts) {

View File

@@ -28,7 +28,7 @@ export function findUnused({ absolute }: { absolute: boolean }) {
(name === 'data' || name === 'indented_data_reference') &&
args.startsWith('reusables.')
) {
const reusableName = path.join('data', ...args.split(' ')[0].split('.')) + '.md'
const reusableName = `${path.join('data', ...args.split(' ')[0].split('.'))}.md`
// Special cases where we don't want them to count as reusables. It's an example in a how-to doc
if (
reusableName.includes('foo/bar.md') ||

View File

@@ -65,7 +65,7 @@ export function findTopUsed(numberOfMostUsedToFind: number, { absolute }: { abso
console.log(`\nTop ${numberOfMostUsedToFind} most used reusables:`)
let i = 0
for (const [reusable, count] of sortedCounts.slice(0, numberOfMostUsedToFind)) {
let printReusablePath = path.join('data', ...reusable.split('.')) + '.md'
let printReusablePath = `${path.join('data', ...reusable.split('.'))}.md`
if (absolute) {
printReusablePath = path.resolve(printReusablePath)
}

View File

@@ -31,7 +31,7 @@ async function main(nameTuple: [string, string]) {
const parentIndexMd = path.join(path.dirname(after), 'index.md')
const fileContent = fs.readFileSync(parentIndexMd, 'utf-8')
const { data } = readFrontmatter(fileContent)
const afterShortname = '/' + after.split('/').slice(-1)[0].replace(/\.md$/, '')
const afterShortname = `/${after.split('/').slice(-1)[0].replace(/\.md$/, '')}`
if (data) assert(data.children.includes(afterShortname), `Child ${afterShortname} not found`)
}
} else {
@@ -43,7 +43,7 @@ async function main(nameTuple: [string, string]) {
const parentIndexMd = path.join(path.dirname(after), 'index.md')
const fileContent = fs.readFileSync(parentIndexMd, 'utf-8')
const { data } = readFrontmatter(fileContent)
const afterShortname = '/' + after.split('/').slice(-1)
const afterShortname = `/${after.split('/').slice(-1)}`
if (data) assert(data.children.includes(afterShortname), `Child ${afterShortname} not found`)
}
}
@@ -57,5 +57,5 @@ function makeHref(root: string, filePath: string) {
const last = nameSplit.pop()
if (last) nameSplit.push(last.replace(/\.md$/, ''))
}
return '/' + nameSplit.join('/')
return `/${nameSplit.join('/')}`
}

View File

@@ -43,7 +43,7 @@ export default function alerts({ alertTitles = {} }: { alertTitles?: Record<stri
}
const alertType = alertTypes[getAlertKey(node).toUpperCase()]
node.tagName = 'div'
node.properties.className = 'ghd-alert ghd-alert-' + alertType.color
node.properties.className = `ghd-alert ghd-alert-${alertType.color}`
node.properties.dataContainer = 'alert'
node.children = [
h(