Skip to content

Commit 6355fab

Browse files
committed
feat: set moduleDetection to force
It's considered a good practice as illustrated in: https://www.totaltypescript.com/cannot-redeclare-block-scoped-variable#solution-3-your-module-isnt-a-module
1 parent 27fa57b commit 6355fab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"moduleResolution": "bundler",
1717
"resolveJsonModule": true,
1818
"allowImportingTsExtensions": true,
19+
// Even files without `import` or `export` are treated as modules.
20+
// It helps to avoid mysterious errors such as `Cannot redeclare block-scoped variable 'name`.
21+
// https://www.totaltypescript.com/cannot-redeclare-block-scoped-variable#solution-3-your-module-isnt-a-module
22+
"moduleDetection": "force",
1923

2024
// Required in Vue projects
2125
"jsx": "preserve",

0 commit comments

Comments
 (0)