Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benmerckx/find-jsx-strings

Find hardcoded strings in jsx/tsx files
https://github.com/benmerckx/find-jsx-strings

i18n jsx translation typescript

Last synced: 20 days ago
JSON representation

Find hardcoded strings in jsx/tsx files

Awesome Lists containing this project

README

        

# find-jsx-strings

Utility to find hardcoded strings in jsx/tsx files (so they can be replaced by translations).

## Usage

```sh
npx find-jsx-strings [opts]
```

## Example

```tsx
// index.tsx
export default function App() {
return (


Hello


Start editing


Some alt text

)
}
```

```sh
npx find-jsx-strings .
```

Will report:

```
index.tsx:6
6 │

Hello


· ─────

index.tsx:7
7 │

Start editing


· ─────────────

index.tsx:8
8 │ Some alt text
· ───────────────
```

## Options

```
-A, --skip-attributes Skip all string attributes or accepts comma separated list
--skip-text Skip all JSX text
-P, --skip-pattern Skip text or attributes that include this string
--skip-files Skip all files that include these strings (comma separated list)
--include-literal Include reporting string literals
--include-template Include reporting template literals
-v, --version Displays current version
-h, --help Display help message
```