Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@babel/plugin-transform-computed-properties
Advanced tools
The @babel/plugin-transform-computed-properties npm package is a plugin for Babel that transforms computed property names in objects. This allows you to use expressions to define property names in your objects, which are evaluated at runtime.
Computed Property Names
This feature allows you to use expressions inside square brackets to compute property names for objects. The expression inside the brackets is evaluated and the result is used as the property name.
{"var obj = {['foo' + bar]: 'baz'};"}
This plugin allows Babel to transform the spread operator in arrays and function calls. While it does not directly relate to computed properties, it is another example of a Babel plugin that transforms modern JavaScript syntax into a form compatible with older environments.
Similar to the spread transform plugin, this one is for transforming object rest and spread properties. It does not handle computed properties, but it is related in the sense that it deals with object property manipulation.
This plugin transforms destructuring assignments and rest properties for more consistent code. It does not provide the same functionality as the computed properties plugin but is another tool for handling object properties.
Compile ES2015 computed properties to ES5
See our website @babel/plugin-transform-computed-properties for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-computed-properties
or using yarn:
yarn add @babel/plugin-transform-computed-properties --dev
v7.20.7 (2022-12-22)
babel-helper-member-expression-to-functions
, babel-helper-replace-supers
, babel-plugin-proposal-class-properties
, babel-plugin-transform-classes
babel-helpers
, babel-plugin-proposal-class-properties
, babel-plugin-transform-classes
, babel-plugin-transform-object-super
babel-parser
, babel-plugin-transform-typescript
babel-traverse
.parentPath
after rename in SwitchCase
(@nicolo-ribaudo)babel-plugin-transform-typescript
, babel-traverse
babel-plugin-transform-block-scoping
babel-plugin-proposal-async-generator-functions
, babel-preset-env
for await
with shadowed variables (@liuxingbaoyu)babel-generator
, babel-plugin-proposal-optional-chaining
(a ?? b) as T
(@liuxingbaoyu)babel-plugin-transform-react-jsx
, babel-types
JSXText
(@liuxingbaoyu)babel-core
, babel-helpers
, babel-plugin-transform-computed-properties
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
babel-helper-member-expression-to-functions
, babel-helper-replace-supers
, babel-plugin-proposal-class-properties
, babel-plugin-transform-classes
babel-generator
TSEnumMember
(@liuxingbaoyu)babel-plugin-transform-block-scoping
, babel-traverse
babel-helper-define-map
, babel-plugin-transform-property-mutators
@babel/helper-define-map
(@nicolo-ribaudo)babel-core
, babel-plugin-proposal-class-properties
, babel-plugin-transform-block-scoping
, babel-plugin-transform-classes
, babel-plugin-transform-destructuring
, babel-plugin-transform-parameters
, babel-plugin-transform-regenerator
, babel-plugin-transform-runtime
, babel-preset-env
, babel-traverse
transform-block-scoping
plugin (@nicolo-ribaudo)babel-helper-compilation-targets
getTargets
(@liuxingbaoyu)FAQs
Compile ES2015 computed properties to ES5
The npm package @babel/plugin-transform-computed-properties receives a total of 0 weekly downloads. As such, @babel/plugin-transform-computed-properties popularity was classified as not popular.
We found that @babel/plugin-transform-computed-properties demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.