0.0.7 • Published 3 years ago

find-jsx-strings v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years 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

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago