
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@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,446 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.