Remove disabling of prefer-template eslint rule (#58230)
This commit is contained in:
@@ -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">'
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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') ||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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('/')}`
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user