https://github.com/nucleartux/i18next-scanner-typescript
Typescript transform for i18next-scanner
https://github.com/nucleartux/i18next-scanner-typescript
i18n i18next i18next-scanner react
Last synced: about 1 year ago
JSON representation
Typescript transform for i18next-scanner
- Host: GitHub
- URL: https://github.com/nucleartux/i18next-scanner-typescript
- Owner: nucleartux
- License: mit
- Created: 2019-02-18T19:04:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T13:46:10.000Z (about 2 years ago)
- Last Synced: 2025-03-30T01:38:14.413Z (over 1 year ago)
- Topics: i18n, i18next, i18next-scanner, react
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 36
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## i18next-scanner-typescript
Typescript support for [i18next-scanner](https://github.com/i18next/i18next-scanner/)
## Install
```bash
yarn add -D i18next-scanner-typescript
```
## Usage
```js
const typescriptTransform = require('i18next-scanner-typescript');
module.exports = {
options: {
func: {
// don't pass ts or tsx here!
extensions: ['.js', '.jsx'],
},
trans: {
// don't pass ts or tsx here!
extensions: ['.js', '.jsx'],
},
},
// your i18next-scanner config
// ...
transform: typescriptTransform(
// options
{
// default value for extensions
extensions: [".ts", ".tsx"],
// optional ts configuration
tsOptions: {
target: "es2017",
},
},
// optional custom transform function
function customTransform(outputText, file, enc, done) {
// do something custom with the transpiled `outputText`
parser.parseTransFromString(outputText);
parser.parseFuncFromString(outputText);
done();
},
),
};
```
Double check that you don't have TS extensions in the non-transform configuration