@u27n/typescript
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

U27N Typescript Plugin

This is a U27N plugin for translating typescript or plain javascript sources.

When writing text fragments, this plugin will automatically add and update fragment ids:

t("Hello World!");
// will be changed to:
t("Hello World!", "<some id>");

Setup

npm install --save-dev @u27n/typescript

Add the following to your u27n.json file:

{
    "include": [
        // Include typescript and javascript sources:
        "./src/*.{ts,tsx,js,jsx}"
    ],

    "plugins": [
        // Use all defaults:
        "@u27n/typescript",

        // Or customize the following default config:
        {
            "entry": "@u27n/typescript",
            "config": {
                // Path of the tsconfig file that is used
                // for mapping output filenames:
                "tsconfig": "./tsconfig.json",

                // If true, the parser tries to parse comment content as typescript
                // and marks fragments found in comments as disabled.
                "parseComments": false,

                // An array of function names to use.
                "functionNames": ["t"]
            }
        }
    ]
}

Compatibility

The table below shows what core and typescript versions are supported by this package.

@u27n/typescript @u27n/core typescript
4.x 3.x 5.x
3.x 2.x 5.x

Readme

Keywords

none

Package Sidebar

Install

npm i @u27n/typescript

Weekly Downloads

0

Version

4.0.0

License

none

Unpacked Size

47.9 kB

Total Files

39

Last publish

Collaborators

  • mpt