Skip to content

Commit ac244a7

Browse files
author
jared
committed
Moved tsConfigJson as a parameter in lbf-typescript.nix
1 parent e0d57ee commit ac244a7

File tree

1 file changed

+42
-40
lines changed

1 file changed

+42
-40
lines changed

extras/lbf-nix/lbf-typescript.nix

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,48 @@ lbfTypescriptOpts@{
3737
# Examples: version = "0.1.0.0"
3838
version ? "1.0.0"
3939

40+
, # `tsconfig.json` for TypeScript. Note that the typechecking options do
41+
# nothing as TypeScript's semantic checking is disabled.
42+
tsConfigJson ? pkgs.writeTextFile {
43+
name = "lambda-buffers-tsconfig-json-template";
44+
text =
45+
''
46+
{
47+
"compilerOptions": {
48+
"target": "es2020",
49+
"module": "node16",
50+
"moduleResolution": "node16",
51+
"rootDir": "./src",
52+
"declaration": true,
53+
"declarationMap": true,
54+
"sourceMap": true,
55+
"outDir": "./dist",
56+
"verbatimModuleSyntax": true,
57+
"forceConsistentCasingInFileNames": true,
58+
59+
/* Type Checking */
60+
"strict": true,
61+
"noImplicitAny": true,
62+
"strictNullChecks": true,
63+
"strictFunctionTypes": true,
64+
"strictBindCallApply": true,
65+
"strictPropertyInitialization": true,
66+
"noImplicitThis": true,
67+
"useUnknownInCatchVariables": true,
68+
"alwaysStrict": true,
69+
"exactOptionalPropertyTypes": true,
70+
"noUncheckedIndexedAccess": true,
71+
"noImplicitOverride": true,
72+
"noPropertyAccessFromIndexSignature": true,
73+
"noImplicitReturns": true,
74+
"noFallthroughCasesInSwitch": true,
75+
"noUnusedLocals": true,
76+
"noUnusedParameters": true,
77+
}
78+
}
79+
'';
80+
}
81+
4082
}:
4183
let
4284
lbf-build = import ./lbf-build.nix pkgs lbf;
@@ -151,46 +193,6 @@ let
151193
'';
152194
};
153195

154-
# TODO(jaredponn): allow this to be passed in as a parameter
155-
tsConfigJson = pkgs.writeTextFile {
156-
name = "lambda-buffers-tsconfig-json-template";
157-
text =
158-
''
159-
{
160-
"compilerOptions": {
161-
"target": "es2020",
162-
"module": "node16",
163-
"moduleResolution": "node16",
164-
"rootDir": "./src",
165-
"declaration": true,
166-
"declarationMap": true,
167-
"sourceMap": true,
168-
"outDir": "./dist",
169-
"verbatimModuleSyntax": true,
170-
"forceConsistentCasingInFileNames": true,
171-
172-
/* Type Checking */
173-
"strict": true,
174-
"noImplicitAny": true,
175-
"strictNullChecks": true,
176-
"strictFunctionTypes": true,
177-
"strictBindCallApply": true,
178-
"strictPropertyInitialization": true,
179-
"noImplicitThis": true,
180-
"useUnknownInCatchVariables": true,
181-
"alwaysStrict": true,
182-
"exactOptionalPropertyTypes": true,
183-
"noUncheckedIndexedAccess": true,
184-
"noImplicitOverride": true,
185-
"noPropertyAccessFromIndexSignature": true,
186-
"noImplicitReturns": true,
187-
"noFallthroughCasesInSwitch": true,
188-
"noUnusedLocals": true,
189-
"noUnusedParameters": true,
190-
}
191-
}
192-
'';
193-
};
194196

195197
# `lbTypescriptSrc` is the Typescript generated code from LambdaBuffers
196198
# Notes:

0 commit comments

Comments
 (0)