Skip to content

Experimental project to figure out how to make a custom TypeScript transformation from a json import to an inline object as const

Notifications You must be signed in to change notification settings

fram-x/transform-json-import-to-inline-object-as-const

Repository files navigation

transform-json-import-to-inline-object-as-const

Experimental project to figure out how to make a custom TypeScript transformation from a json import to an inline object as const.

To try it out:

  • clone repository
  • yarn

To build:

  • yarn ttsc --outDir ./build

Challenges as described in this SO post

  • How to configure VS Code use the custom transformation of import c from './some.json'; to const c = { "test": "Hello world!" } as const;, e.g. for type checking and intellisense support
  • How to configure build to use type during type checking

About

Experimental project to figure out how to make a custom TypeScript transformation from a json import to an inline object as const

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published