Skip to content

Commit

Permalink
chore: Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jespertheend committed Feb 14, 2023
1 parent 10b569c commit 151edcb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
8 changes: 8 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@
"indentWidth": 4,
"lineWidth": 120
}
},
"lint": {
"files": {
"exclude": [".denoTypes"]
},
"rules": {
"exclude": ["no-inner-declarations"]
}
}
}
2 changes: 1 addition & 1 deletion mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export {};
let preCollectedImportsJson = null;
try {
preCollectedImportsJson = JSON.parse(preCollectedImportsStr);
} catch (e) {
} catch {
throw new Error(
`The file at ${preCollectedImportsFilePath} appears to be corrupt and couldn't be parsed.`,
);
Expand Down
1 change: 0 additions & 1 deletion src/collectImports.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import { getIncludeExcludeFiles } from "./common.js";
import { parseFilePathAst } from "./parseFileAst.js";
import ts from "npm:typescript@4.7.4";
import * as path from "https://deno.land/std@0.145.0/path/mod.ts";
import { resolveModuleSpecifier } from "https://deno.land/x/import_maps@v0.1.1/mod.js";

Expand Down
4 changes: 2 additions & 2 deletions src/parseFileAst.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ts from "npm:typescript@4.7.4";
*/
export async function parseFilePathAst(filePath, cbNode) {
const fileContent = await Deno.readTextFile(filePath);
return await parseFileAst(fileContent, filePath, cbNode);
return parseFileAst(fileContent, filePath, cbNode);
}

/**
Expand All @@ -23,7 +23,7 @@ export async function parseFilePathAst(filePath, cbNode) {
* @param {(node: ts.Node, extra: ParseFileAstExtra) => void} [cbNode] The
* callback that is called for each node in the ast.
*/
export async function parseFileAst(fileContent, filePath, cbNode) {
export function parseFileAst(fileContent, filePath, cbNode) {
const program = ts.createProgram([filePath], {
noResolve: true,
target: ts.ScriptTarget.Latest,
Expand Down
13 changes: 0 additions & 13 deletions test/tests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,6 @@ function createNotAny() {
`;
}

const thisIsAny = /** @type {any} */ ("sldkfj");
const thisIsNotAny = "sdlfkj";

(function () {
/** @param {boolean} variable */
function expectsBool(variable) {}
/** @param {string} variable */
function expectsString(variable) {}

expectsBool(thisIsAny);
expectsString(thisIsNotAny);
})();

Deno.test({
name: "Basic type generation",
async fn() {
Expand Down

0 comments on commit 151edcb

Please sign in to comment.