typescript-json-as-const-plugin
Plugin changes the way how typescript inferencing JSON files typings to as const
behavior. It is part of nanointl project but may be used apart.
Installation
pnpm add -D typescript-json-as-const-plugin
# or: npm install --save-dev typescript-json-as-const-plugin
Usage
- Add plugin to your
tsconfig.json
{
"compilerOptions": {
...
"plugins": [
+ { "name": "typescript-json-as-const-plugin", "include": ["./src/locales"] },
...
]
},
...
}
-
(VS Code only) switch to workspace version of Typescript
-
Restart typescript server.