0.0.7 • Published 1 year ago

find-jsx-strings v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

find-jsx-strings

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

Usage

npx find-jsx-strings <dir> [opts]

Example

// index.tsx
export default function App() {
  return (
    <div>
      <h1>Hello</h1>
      <p>Start editing</p>
      <img alt="Some alt text" other={true} data-test />
    </div>
  )
}
npx find-jsx-strings .

Will report:

index.tsx:6
 6 │       <h1>Hello</h1>
   ·           ─────

index.tsx:7
 7 │       <p>Start editing</p>
   ·          ─────────────

index.tsx:8
 8 │       <img alt="Some alt text" other={true} data-test />
   ·                ───────────────

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
0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago