Skip to content

Commit 18eb258

Browse files
committed
move up common settings from js
1 parent e8d93ff commit 18eb258

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

node.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,36 @@
44
"display": "Shared node base",
55

66
"compilerOptions": {
7+
"allowImportingTsExtensions": true,
78
"moduleResolution": "node",
89

910
// "module": "NodeNext",
1011
"module": "esnext", // pulumi complains of es2022
1112
"target": "esnext", // pulumi complains of es2022
1213

14+
1315
// ----
1416
// https://github.com/sindresorhus/tsconfig/blob/main/tsconfig.json
1517
"lib": ["dom", "dom.iterable", "es2020"],
16-
18+
1719
"allowSyntheticDefaultImports": true, // To provide backwards compatibility, Node.js allows you to import most CommonJS packages with a default import. This flag tells TypeScript that it's okay to use import on CommonJS modules.
1820
"resolveJsonModule": true,
19-
21+
2022
// ----
2123
// from node18 base, but changed lib/module/target
2224
"strict": true,
2325
"esModuleInterop": true,
2426
"skipLibCheck": true,
2527
"forceConsistentCasingInFileNames": true,
26-
28+
2729
// ----
2830
// Our alterations to the base
2931
// "allowSyntheticDefaultImports": true,
30-
32+
3133
// Ensure that .d.ts files are created by tsc
3234
"declaration": true,
33-
// Do not allow js
34-
"allowJs": false,
35+
"allowJs": true,
36+
"maxNodeModuleJsDepth": 10,
3537
// No js, ts, maps when errors are reported
3638
"noEmitOnError": true,
3739
// Do not allow inference to fall back to any type
@@ -40,6 +42,8 @@
4042
"noImplicitReturns": true,
4143
// Report errors on unused local variables.
4244
"noUnusedLocals": false,
45+
// Resolve JSON modules for imports
46+
"resolveJsonModule": true,
4347
// obj[foo] suppression
4448
// "suppressImplicitAnyIndexErrors": true, -- deprecated in 5.0
4549

react.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
"extends": "@tsconfig/create-react-app/tsconfig.json",
66

77
"compilerOptions": {
8+
"allowImportingTsExtensions": true,
89
// All packages should be ESM, only the final webpack should be different.
910
"target": "esnext",
1011
"module": "esnext",
11-
// Final webpack should target modern browsers instead of es5 with es2015
12-
// "target": "es2015",
13-
14-
// Do not allow js
15-
"allowJs": false,
12+
"moduleResolution": "bundler",
13+
// React/JSX configuration
14+
"jsx": "react-jsx",
15+
"allowJs": true,
16+
"maxNodeModuleJsDepth": 10,
1617
// No js, ts, maps when errors are reported
1718
"noEmitOnError": true,
1819
// Do not allow inference to fall back to any type
@@ -21,6 +22,7 @@
2122
"noImplicitReturns": true,
2223
// Report errors on unused local variables.
2324
"noUnusedLocals": false,
25+
// Resolve JSON modules for imports
2426
"resolveJsonModule": true,
2527
// obj[foo] suppression
2628
// "suppressImplicitAnyIndexErrors": true, -- deprecated in 5.0
@@ -33,9 +35,6 @@
3335
// Ensure that Babel can safely transpile files in the TypeScript project
3436
"isolatedModules": true,
3537

36-
// material-ui uses emotion https://emotion.sh/docs/typescript
37-
// "jsxImportSource": "@emotion/react", NEED for mui 5.x
38-
3938
// https://github.com/jquense/yup#typescript-configuration
4039
"strictFunctionTypes": false,
4140

0 commit comments

Comments
 (0)