Skip to content

Commit

Permalink
feat(ts): add verbatimModuleSyntax
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed May 30, 2024
1 parent 0884384 commit a137e94
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/decisions/005-verbatim-module-syntax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Title

Date: 2024-05-30

Status: accepted

## Context

The best context for this can be gathered by reading
[the TypeScript docs on `verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax).

The short version of this is that it helps TypeScript (and other compilers that
strip types) to know whether to keep a module import or not.

The idea is: If the import is only there to import types, then it's removed. If
it imports values then it is not.

## Decision

Because it's more predictable behavior (and recommended by TypeScript) we will
enable this rule.

## Consequences

The only change people should experience with this change is a more consistent
and correct behavior. It's unlikely anyone will notice this change, but if they
do it will probably be because it fixed a bug.
1 change: 1 addition & 0 deletions typescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"skipLibCheck": true,
"allowImportingTsExtensions": true,
"noUncheckedIndexedAccess": true,
"verbatimModuleSyntax": true,
"noEmit": true
}
}

0 comments on commit a137e94

Please sign in to comment.