Prettify all JavaScript files (#964)

* Prettify all JavaScript files

* Make trailingComma all

* Delete v2/.prettierignore

* Remove v2 Prettier commands in package.json
This commit is contained in:
Yangshun Tay 2018-09-17 15:34:55 +08:00 committed by GitHub
parent a1de6dab04
commit 9d4a5d5359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 441 additions and 473 deletions

View file

@ -45,9 +45,9 @@ let customTranslations = {
if (fs.existsSync(`${CWD}/data/custom-translation-strings.json`)) {
customTranslations = deepmerge(
JSON.parse(
fs.readFileSync(`${CWD}/data/custom-translation-strings.json`, 'utf8')
fs.readFileSync(`${CWD}/data/custom-translation-strings.json`, 'utf8'),
),
customTranslations
customTranslations,
);
}
@ -121,7 +121,7 @@ function execute() {
if (!file.endsWith('-sidebars.json')) {
if (file.endsWith('-sidebar.json')) {
console.warn(
`Skipping ${file}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`
`Skipping ${file}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`,
);
}
return;
@ -185,11 +185,11 @@ function execute() {
] = 'Translate';
translations['pages-strings'] = Object.assign(
translations['pages-strings'],
customTranslations['pages-strings']
customTranslations['pages-strings'],
);
translations['localized-strings'] = deepmerge(
translations['localized-strings'],
customTranslations['localized-strings']
customTranslations['localized-strings'],
);
writeFileAndCreateFolder(
`${CWD}/i18n/en.json`,
@ -198,11 +198,11 @@ function execute() {
{
_comment: 'This file is auto-generated by write-translations.js',
},
translations
translations,
),
null,
2
)}\n`
2,
)}\n`,
);
}