1
0
mirror of synced 2025-12-23 21:07:12 -05:00

Pretty format (#20352)

* Update prettier flow to include JS

* Run prettier

* ...run prettier
This commit is contained in:
Kevin Heis
2021-07-14 14:35:01 -07:00
committed by GitHub
parent ae3db795f4
commit 8a56437c93
333 changed files with 6904 additions and 5350 deletions

View File

@@ -21,12 +21,11 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
//
// [end-readme]
main()
async function main () {
async function main() {
const fixableFmProps = Object.keys(fm.schema.properties)
.filter(property => !fm.schema.properties[property].translatable)
.filter((property) => !fm.schema.properties[property].translatable)
.sort()
const fixableYmlProps = ['date']
@@ -40,12 +39,13 @@ async function main () {
}
if (path.endsWith('yml')) {
let data; let errors = []
let data
let errors = []
try {
data = yaml.load(fileContents)
} catch {}
if (data && schema) {
({ errors } = revalidator.validate(data, schema))
;({ errors } = revalidator.validate(data, schema))
}
return { data, errors, content: null }
} else {
@@ -53,7 +53,8 @@ async function main () {
}
}
const cmd = 'git -c diff.renameLimit=10000 diff --name-only origin/main | egrep "^translations/.*/(content/.+.md|data/release-notes/.*.yml)$"'
const cmd =
'git -c diff.renameLimit=10000 diff --name-only origin/main | egrep "^translations/.*/(content/.+.md|data/release-notes/.*.yml)$"'
const changedFilesRelPaths = execSync(cmd).toString().split('\n')
for (const relPath of changedFilesRelPaths) {