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

babel-preset-airbnb

Package Overview
Dependencies
Maintainers
5
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 3.1.0 to 3.2.0

7

CHANGELOG.md

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

## [3.2.0] - 2018-12-14
* [New] add `looseClasses` option to compile classes in loose mode (#46)
* [New] infer default value of `jscript` option from explorer target version (#47)
## [3.1.0] - 2018-12-13
* [New] add `jscript` option to disable JScript transformation (#45)
## [3.0.1] - 2018-10-08

@@ -8,0 +15,0 @@ * [Fix] the env preset only accepts `false` or a string, not explicit options

12

index.js

@@ -27,5 +27,11 @@ 'use strict';

removePropTypes,
jscript = true,
looseClasses = false,
} = options;
// jscript option is deprecated in favor of using the explorer target version
// TODO: remove this option entirely in the next major release.
const jscript = Object.prototype.hasOwnProperty.call(options, 'jscript')
? options.jscript
: (targets.explorer >= 6 && targets.explorer <= 8);
if (typeof modules !== 'undefined' && typeof modules !== 'boolean' && modules !== 'auto') {

@@ -55,2 +61,6 @@ throw new TypeError('babel-preset-airbnb only accepts `true`, `false`, or `"auto"` as the value of the "modules" option');

plugins: [
looseClasses ? [require('@babel/plugin-transform-classes'), {
loose: true,
}] : null,
removePropTypes ? [require('babel-plugin-transform-react-remove-prop-types'), Object.assign({

@@ -57,0 +67,0 @@ mode: 'wrap',

3

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

@@ -21,2 +21,3 @@ "main": "index.js",

"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-classes": "^7.2.0",
"@babel/plugin-transform-exponentiation-operator": "^7.0.0",

@@ -23,0 +24,0 @@ "@babel/plugin-transform-jscript": "^7.0.0",

@@ -153,5 +153,5 @@ # babel-preset-airbnb

## JScript
## Classes loose mode
This preset uses a transform to protect against JScript bugs in older versions of Internet Explorer. If you'd like to disable this, set the `jscript` option to `false`:
By default, this preset will compile classes in normal mode. This is safer, but comes with a bundle size and runtime overhead. To [compile classes in loose mode](https://babeljs.io/docs/en/babel-plugin-transform-classes#loose), set the `looseClasses` option to `true`:

@@ -161,5 +161,7 @@ ```json

"presets": [["airbnb", {
"jscript": false,
"looseClasses": true,
}]]
}
```
The [risks of enabling loose classes are outlined in the Babel docs](https://babeljs.io/docs/en/babel-plugin-transform-classes#loose).
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