Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-preset-airbnb

Package Overview
Dependencies
Maintainers
7
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-airbnb - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

3

CHANGELOG.md

@@ -6,2 +6,5 @@ # Change Log

## [4.1.0] - 2019.10.3
* [New] Allow specifying the Babel runtime version
## [4.0.1] - 2019.06.26

@@ -8,0 +11,0 @@ * update license to MIT

@@ -27,2 +27,3 @@ 'use strict';

looseClasses = false,
runtimeVersion,
} = options;

@@ -88,2 +89,3 @@

useESModules: !computedModulesOption,
version: runtimeVersion,
}],

@@ -90,0 +92,0 @@ ].filter(Boolean),

2

package.json
{
"name": "babel-preset-airbnb",
"version": "4.0.1",
"version": "4.1.0",
"description": "A babel preset for transforming your JavaScript for Airbnb",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -166,1 +166,19 @@ # babel-preset-airbnb

The [risks of enabling loose classes are outlined in the Babel docs](https://babeljs.io/docs/en/babel-plugin-transform-classes#loose).
## Specifying a babel runtime version
By default @babel/plugin-transform-runtime will [assume the oldest version of the runtime](https://github.com/babel/babel/blob/e6264a09921c60b8f18870d0a75678e4fa04f0f8/packages/babel-plugin-transform-runtime/src/index.js#L42) to avoid importing helpers that don't exist which would fail at runtime. This can result in newer helpers being inlined into modules (ex. objectSpread2) which increases bundle size.
To avoid this you can configure the preset to use the same version of the runtime that's installed in your package.json.
ex. If package.json has `"@babel/runtime": "^7.5.5"` then you can use:
```json
{
"presets": [["airbnb", {
"runtimeVersion": "7.5.5",
}]]
}
```
Note that this will result in a runtime breakage if the version passed into the airbnb preset is newer than the version of the babel runtime actually being used at build time.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc