Skip to content
Permalink
Browse files

Fix eslint warnings and small clean ups (#339)

  • Loading branch information...
zekth authored and ry committed Apr 14, 2019
1 parent 4d25cc1 commit 95ab4e2a3c8ac5fd7a1175567848ba7c2161b9e3
Showing with 6 additions and 5 deletions.
  1. +1 −1 fs/README.md
  2. +2 −1 prettier/main_test.ts
  3. +1 −1 testing/main.ts
  4. +2 −2 toml/parser.ts
@@ -31,7 +31,7 @@ ensureDir("./bar"); // returns a promise
ensureDirSync("./ensureDirSync"); // void
```

### ensure_file
### ensureFile

Ensures that the file exists.
If the file that is requested to be created is in directories
@@ -107,7 +107,8 @@ test(async function testPrettierOptions() {
const file2 = join(testdata, "opts", "2.ts");
const file3 = join(testdata, "opts", "3.md");

const getSourceCode = async f => decoder.decode(await Deno.readFile(f));
const getSourceCode = async (f: string): Promise<string> =>
decoder.decode(await Deno.readFile(f));

await run([...cmd, "--no-semi", file0]);
assertEquals(
@@ -1,7 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { runTests } from "./mod.ts";

async function main() {
async function main(): Promise<void> {
// Testing entire test suite serially
await runTests();
}
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { existsSync } from "../fs/exists.ts";
import { readFileStrSync } from "../fs/read_file_str.ts";
import { deepAssign } from "../util/deep_assign.ts";
import { pad } from "../strings/pad.ts";

@@ -542,7 +543,6 @@ export function parseFile(filePath: string): object {
if (!existsSync(filePath)) {
throw new Error("File not found");
}
const decoder = new TextDecoder();
const strFile = decoder.decode(Deno.readFileSync(filePath));
const strFile = readFileStrSync(filePath);
return parse(strFile);
}

0 comments on commit 95ab4e2

Please sign in to comment.
You can’t perform that action at this time.