Skip to content

Commit

Permalink
refactor(tsconfig): Configure TS to be stricter (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 committed Apr 10, 2022
1 parent 32a9c46 commit 9c294dc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
7 changes: 0 additions & 7 deletions scripts/trie/decode-trie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export function decodeNode(
if (val !== -1) {
const code = jumpOffset + i;

console.log("CODE", String.fromCharCode(code), i, val);

decodeNode(
decodeMap,
resultMap,
Expand All @@ -63,11 +61,6 @@ export function decodeNode(
}
} else {
for (let i = 0; i < branchLength; i++) {
console.log(
"BRANCH",
String.fromCharCode(decodeMap[branchIdx + i])
);

decodeNode(
decodeMap,
resultMap,
Expand Down
2 changes: 1 addition & 1 deletion scripts/trie/encode-trie.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as assert from "assert";
import { TrieNode } from "./trie.js";
import type { TrieNode } from "./trie.js";

function binaryLength(num: number) {
return Math.ceil(Math.log2(num));
Expand Down
34 changes: 19 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
// "lib": [], /* Specify library files to be included in the compilation. */
"declaration": true /* Generates corresponding '.d.ts' file. */,
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
"outDir": "lib" /* Redirect output structure to the directory. */,
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"target": "es5",
"module": "commonjs",
"lib": ["ES2015.Core"],
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "lib",

/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
"strict": true,

/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */,
"noUnusedParameters": true /* Report errors on unused parameters. */,
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUnusedLocals": true,
"noUnusedParameters": true,

/* Module Resolution Options */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true
},
Expand Down

0 comments on commit 9c294dc

Please sign in to comment.