vsashyn / babel-plugin-lookup-literals

Plugin that helps find string literals in codebase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

babel-plugin-lookup-literals

Helps to find string literals in your code. Useful in case of l10n enhancements.

Example

In

// input code

Out

"use strict";

// output code

Installation

$ npm install babel-plugin-lookup-literals

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["lookup-literals", {
                    "trackStringLiteral": false,
                    "trackJSXText": true
    }]
}

Via CLI

$ babel --plugins lookup-literals script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["lookup-literals"]
});

Example

Shows found literals in console. Plugin doesn't change source code.

About

Plugin that helps find string literals in codebase


Languages

Language:JavaScript 100.0%