
Security News
CISA Extends MITRE Contract as Crisis Accelerates Alternative CVE Coordination Efforts
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
@splunk/babel-preset
Advanced tools
A standardized preset for Babel to work with the latest and greatest TypeScript and JavaScript have to offer.
This preset is used to strip type information from .ts(x)
files. Doing so allows us to work on TypeScript files without the overhead of type checking.
For type checking, please use one of the available TypeScript loaders or tsc
in your project.
Note: You may need to specify
--extensions ".ts"
if you're relying on@babel/cli
&@babel/node
CLIs to handle .ts files.
This is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, browser polyfills) are needed by your target environment(s).
We provide this as-is with only the default options enabled.
This preset allows for the transpiling of JSX.
This plugin is remarkably useful with regards to TypeScript classes as it allows us to use class field declarations:
class Bork {
//Property initializer syntax with type information
sound: string = "bork";
// Bound method
public playSound = () => {
return this.sound;
}
}
const myBork = new Bork();
myBork.playSound // "bork"
This is the second of two code transforms that we expose.
This allows developers to make use of rest operators inside objects:
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
// ^-- { a: 3, b: 4 }
As well as spreads:
let n = { x, y, ...z }; // { x: 1, y: 2, a: 3, b: 4 }
$ npm install --save-dev @babel/core^7
$ npm install --save-dev @splunk/babel-preset
Add the preset to your babel configuration:
{
"presets": ["@splunk/babel-preset"]
}
Each of our presets can consume an options object as such:
{
"presets": ["@splunk/babel-preset", {
// These options are passed to @babel/preset-env
"envPresetOptions": { ... },
// These options are passed to @babel/preset-react
"reactPresetOptions" : { ... },
// These options are passed to @babel/preset-typescript
"typescriptPresetOptions": { ... }
}]
}
📖Please see the URLs at the top of this file for documentation surrounding available options for each of these loaders.
Each preset can be disabled:
{
"presets": ["@splunk/babel-preset", {
"envPresetEnabled": false,
"reactPresetEnabled": false,
"typescriptPresetEnabled": false
}]
}
FAQs
Standardized Splunk Babel preset
The npm package @splunk/babel-preset receives a total of 1,692 weekly downloads. As such, @splunk/babel-preset popularity was classified as popular.
We found that @splunk/babel-preset demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.