All Projects → jviide → babel-plugin-transform-rename-properties

jviide / babel-plugin-transform-rename-properties

Licence: MIT license
A Babel plugin for renaming JavaScript properties

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to babel-plugin-transform-rename-properties

Babel Plugin Wildcard
Wildcard imports import a directories JS files
Stars: ✭ 170 (+794.74%)
Mutual labels:  babel-plugin
S2s
Coding time Compile. A tool to write code fastest.
Stars: ✭ 254 (+1236.84%)
Mutual labels:  babel-plugin
idomizer
An HTML template parser compiling an incremental-dom render factory.
Stars: ✭ 15 (-21.05%)
Mutual labels:  babel-plugin
Param.macro
Partial application syntax and lambda parameters for JavaScript, inspired by Scala's `_` & Kotlin's `it`
Stars: ✭ 170 (+794.74%)
Mutual labels:  babel-plugin
Eslint Import Resolver Babel Module
Custom eslint resolve for babel-plugin-module-resolver
Stars: ✭ 236 (+1142.11%)
Mutual labels:  babel-plugin
babel-plugin-rewire-exports
Babel plugin for stubbing [ES6, ES2015] module exports
Stars: ✭ 62 (+226.32%)
Mutual labels:  babel-plugin
Babel Plugin Graphql Tag
Compiles GraphQL tagged template strings using graphql-tag.
Stars: ✭ 156 (+721.05%)
Mutual labels:  babel-plugin
babel-plugin-solid-labels
Simple, reactive labels for SolidJS
Stars: ✭ 127 (+568.42%)
Mutual labels:  babel-plugin
Xwind
Tailwind CSS as a templating language in JS and CSS-in-JS
Stars: ✭ 249 (+1210.53%)
Mutual labels:  babel-plugin
penv.macro
A macro used with babel-plugin-macros to write configurations for multiple environments, and remove configurations are irrelevant with the specified environment from your codes finally.
Stars: ✭ 73 (+284.21%)
Mutual labels:  babel-plugin
Emotion
👩‍🎤 CSS-in-JS library designed for high performance style composition
Stars: ✭ 14,177 (+74515.79%)
Mutual labels:  babel-plugin
Babel Plugin React Intl Auto
i18n for the component age. Auto management react-intl ID.
Stars: ✭ 203 (+968.42%)
Mutual labels:  babel-plugin
babel-plugin-hyperscript-to-jsx
This plugin transforms react-hyperscript into JSX. Intended to be used as codemod.
Stars: ✭ 20 (+5.26%)
Mutual labels:  babel-plugin
Babel Plugin React Html Attrs
Babel plugin which transforms HTML and SVG attributes on JSX host elements into React-compatible attributes
Stars: ✭ 170 (+794.74%)
Mutual labels:  babel-plugin
babel-plugin-transform-for-of-as-array
Transform all for-of loops into the equivalent array for loop
Stars: ✭ 14 (-26.32%)
Mutual labels:  babel-plugin
Babel Plugin React Css Modules
Transforms styleName to className using compile time CSS module resolution.
Stars: ✭ 1,989 (+10368.42%)
Mutual labels:  babel-plugin
babel-plugin-tailwind-rn
Allows you to use className="w-full md:w-1/2" syntax in your react native projects.
Stars: ✭ 31 (+63.16%)
Mutual labels:  babel-plugin
babel-plugin-solid-undestructure
A Babel plugin for SolidJS that allows you to destructure component props without losing reactivity.
Stars: ✭ 45 (+136.84%)
Mutual labels:  babel-plugin
babel-plugin-feature-flags
A babel transform for managing feature flags
Stars: ✭ 57 (+200%)
Mutual labels:  babel-plugin
nornj
More exciting JS/JSX based on Template Engine, support control flow tags, custom directives, two-way binding, filters and custom operators.
Stars: ✭ 97 (+410.53%)
Mutual labels:  babel-plugin

babel-plugin-transform-rename-properties npm

Rename JavaScript properties.

Installation

$ yarn add --dev babel-plugin-transform-rename-properties

Example

Input file:

const obj = {
  foo: {
    bar: 1
  },
  quux() {
    return 2;
  }
};

const { foo } = obj;

function quux(obj) {
  return obj.foo.bar + obj.quux();
}

.babelrc:

{
  "plugins": [
    [
      "babel-plugin-transform-rename-properties",
      {
        "rename": {
          "foo": "__FOO__",
          "quux": "I HAVE SPACES"
        }
      }
    ]
  ]
}

Output:

const obj = {
  __FOO__: {
    bar: 1
  },
  "I HAVE SPACES"() {
    return 2;
  }
};

const { __FOO__: foo } = obj;

function quux(obj) {
  return obj.__FOO__.bar + obj["I HAVE SPACES"]();
}

License

This plugin is licensed under the MIT license. See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].