mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Format json files in using prettier
This commit is contained in:
parent
51413be5b6
commit
29de9bdce6
8 changed files with 9356 additions and 8558 deletions
24
gulpfile.mjs
24
gulpfile.mjs
|
@ -1936,7 +1936,7 @@ gulp.task(
|
|||
|
||||
gulp.task("lint", function (done) {
|
||||
console.log();
|
||||
console.log("### Linting JS/CSS files");
|
||||
console.log("### Linting JS/CSS/JSON files");
|
||||
|
||||
// Ensure that we lint the Firefox specific *.jsm files too.
|
||||
const esLintOptions = [
|
||||
|
@ -1959,6 +1959,16 @@ gulp.task("lint", function (done) {
|
|||
styleLintOptions.push("--fix");
|
||||
}
|
||||
|
||||
const prettierOptions = [
|
||||
"node_modules/prettier/bin/prettier.cjs",
|
||||
"**/*.json",
|
||||
];
|
||||
if (process.argv.includes("--fix")) {
|
||||
prettierOptions.push("--log-level", "silent", "--write");
|
||||
} else {
|
||||
prettierOptions.push("--log-level", "warn", "--check");
|
||||
}
|
||||
|
||||
const esLintProcess = startNode(esLintOptions, { stdio: "inherit" });
|
||||
esLintProcess.on("close", function (esLintCode) {
|
||||
if (esLintCode !== 0) {
|
||||
|
@ -1972,8 +1982,16 @@ gulp.task("lint", function (done) {
|
|||
done(new Error("Stylelint failed."));
|
||||
return;
|
||||
}
|
||||
console.log("files checked, no errors found");
|
||||
done();
|
||||
|
||||
const prettierProcess = startNode(prettierOptions, { stdio: "inherit" });
|
||||
prettierProcess.on("close", function (prettierCode) {
|
||||
if (prettierCode !== 0) {
|
||||
done(new Error("Prettier failed."));
|
||||
return;
|
||||
}
|
||||
console.log("files checked, no errors found");
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue