summaryrefslogtreecommitdiff
path: root/prettier
diff options
context:
space:
mode:
authorVincent LE GOFF <g_n_s@hotmail.fr>2019-04-24 13:41:23 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-04-24 07:41:22 -0400
commitdcd01dd02530df0e799eb4227087680ffeb80d74 (patch)
tree8cc1dec75dd17c326fea6d7fe471b7e7a31032f7 /prettier
parente1f7a60bb326f8299f339635c0738d28431afa0a (diff)
Eslint fixes (denoland/deno_std#356)
Make warnings fail Original: https://github.com/denoland/deno_std/commit/4543b563a9a01c8c168aafcbfd9d4634effba7fc
Diffstat (limited to 'prettier')
-rwxr-xr-xprettier/main.ts8
-rw-r--r--prettier/main_test.ts6
2 files changed, 8 insertions, 6 deletions
diff --git a/prettier/main.ts b/prettier/main.ts
index f4a2232cc..a11501de1 100755
--- a/prettier/main.ts
+++ b/prettier/main.ts
@@ -188,7 +188,7 @@ async function checkSourceFiles(
const results = await Promise.all(checks);
- if (results.every(result => result)) {
+ if (results.every((result): boolean => result)) {
console.log("Every file is formatted");
exit(0);
} else {
@@ -240,10 +240,12 @@ async function main(opts): Promise<void> {
}
const options = { flags: "g" };
const skip = Array.isArray(ignore)
- ? ignore.map((i: string) => glob(i, options))
+ ? ignore.map((i: string): RegExp => glob(i, options))
: [glob(ignore, options)];
const match =
- args.length > 0 ? args.map((a: string) => glob(a, options)) : undefined;
+ args.length > 0
+ ? args.map((a: string): RegExp => glob(a, options))
+ : undefined;
const files = walk(".", { match, skip });
try {
if (check) {
diff --git a/prettier/main_test.ts b/prettier/main_test.ts
index 3d5d54d66..0c8cca712 100644
--- a/prettier/main_test.ts
+++ b/prettier/main_test.ts
@@ -45,7 +45,7 @@ async function clearTestdataChanges(): Promise<void> {
await xrun({ args: ["git", "checkout", testdata] }).status();
}
-test(async function testPrettierCheckAndFormatFiles() {
+test(async function testPrettierCheckAndFormatFiles(): Promise<void> {
await clearTestdataChanges();
const files = [
@@ -73,7 +73,7 @@ Formatting ./prettier/testdata/1.js`
await clearTestdataChanges();
});
-test(async function testPrettierCheckAndFormatDirs() {
+test(async function testPrettierCheckAndFormatDirs(): Promise<void> {
await clearTestdataChanges();
const dirs = [join(testdata, "foo"), join(testdata, "bar")];
@@ -99,7 +99,7 @@ Formatting ./prettier/testdata/foo/1.js`
await clearTestdataChanges();
});
-test(async function testPrettierOptions() {
+test(async function testPrettierOptions(): Promise<void> {
await clearTestdataChanges();
const file0 = join(testdata, "opts", "0.ts");