Giter VIP home page Giter VIP logo

babel-preset-airbnb's Introduction

babel-preset-airbnb

A babel preset for transforming your JavaScript for Airbnb.

Currently contains transforms for all stage 4 (ES2018) and stage 3 syntax that is permitted in the Airbnb Style Guide. Please note that if usage of a stage 3 proposal is not explicitly mentioned in the Airbnb Style Guide, then it will not be enabled here. Additionally, stage 4 syntax that is excluded is as follows:

  • generators: regenerator-runtime is too heavyweight for our use.
  • async/await: regenerator-runtime is too heavyweight for our use, and async-to-promises is not yet complete enough to be safely used.
  • async iterators: depends on both generators and async functions
  • lifted template literal restrictions: we do not use tagged template literals, nor implement custom DSLs, otherwise we would enable this.

Install

$ npm install --save-dev babel-preset-airbnb

Usage

Via .babelrc (Recommended)

.babelrc

{
  "presets": ["airbnb"]
}

Via CLI

$ babel script.js --presets airbnb

Via Node API

require('@babel/core').transform('code', {
  presets: ['airbnb']
});

Targeting Environments

This module uses @babel/preset-env to target specific environments.

Please refer to @babel/preset-env#targets for a list of available options.

For a list of browsers please see browserlist.

You may override our default list of targets by providing your own targets key.

{
  "presets": [["airbnb", {
    "targets": {
      "chrome": 50,
      "ie": 11,
      "firefox": 45
    }
  }]]
}

The following transpiles only for Node v6.

{
  "presets": [["airbnb", {
    "targets": {
      "node": 6
    }
  }]]
}

If you wish, you can also inherit our default list of browsers and extend them using additionalTargets.

{
  "presets": [["airbnb", {
    "additionalTargets": {
      "chrome": 42,
      "ie": 8
    }
  }]]
}

You may override our default debug option by providing your own debug key.

{
  "presets": [["airbnb", {
    "debug": true
  }]]
}

React Development Mode

When process.env.NODE_ENV is 'development', the development mode will be set for @babel/preset-react.

You may override our default development option by providing your own boolean development key.

{
  "presets": [["airbnb", {
    "development": false
  }]]
}

React PropTypes removal

This preset can be configured to remove propTypes using babel-plugin-transform-react-remove-prop-types with the following default options:

To enable this transformation with the default options, set the removePropTypes option to true:

{
  "presets": [["airbnb", {
    "removePropTypes": true
  }]]
}

The default options that will be used are:

{
  mode: 'wrap',
  additionalLibraries: ['airbnb-prop-types'],
  ignoreFilenames: ['node_modules'],
}

Default options can be overridden using the removePropTypes option. These options will be shallow-merged with the defaults:

{
  "presets": [["airbnb", {
    "removePropTypes": {
      "mode": "remove"
    }
  }]]
}

For example, if you are using this plugin in a deployable app, you might want to use the remove mode for your production build (and disable this transform entirely in development for optimal build speeds).

Classes loose mode

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, set the looseClasses option to true:

{
  "presets": [["airbnb", {
    "looseClasses": true,
  }]]
}

The risks of enabling loose classes are outlined in the Babel docs.

Specifying a babel runtime version

By default @babel/plugin-transform-runtime will assume the oldest version of the runtime 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:

{
  "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.

Disabling plugin-transform-runtime

You can use the transformRuntime option to disable @babel/plugin-transform-runtime. Specifying false will disable the plugin. This option defaults to true.

Specifying module transforms

You can use the modules option to enable transformation of modules given to this preset:

{
  "presets": [["airbnb", {
    "modules": "auto"
  }]]
}

Both true and the option default auto will not transform modules if ES6 module syntax is already supported by the environment, or "commonjs" otherwise. false will not transform modules.

You can use the runtimeHelpersUseESModules option to prevent transformation of runtime helpers to CommonJS modules.

{
  "presets": [["airbnb", {
    "runtimeHelpersUseESModules": true
  }]]
}

true will not transform runtime helpers to CommonJS modules. false will transform runtime helpers to CommonJS modules. The option defaults to true if modules is set to false, and false otherwise.

babel-preset-airbnb's People

Contributors

esprehn avatar etripier avatar gdborton avatar goatslacker avatar ivankalinin avatar lencioni avatar ljharb avatar mattebailey avatar milesj avatar vikr01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

babel-preset-airbnb's Issues

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.1.1 to 7.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

object rest/spread has been in ES2018

We have also enabled object rest/spread, although it is only at stage 2. It will hopefully achieve stage 3 soon.

object rest/spread has been in ES9.

An in-range update of eslint is breaking the build 🚨

Version 4.6.1 of eslint just got published.

Branch Build failing 🚨
Dependency eslint
Current Version 4.6.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v4.6.1
  • bdec46d Build: avoid process leak when generating website (#9217) (Teddy Katz)
  • cb74b87 Fix: avoid adding globals when an env is used with false (fixes #9202) (#9203) (Teddy Katz)
  • f9b7544 Docs: Correct a typo in generator-star-spacing documentation (#9205) (Ethan Rutherford)
  • e5c5e83 Build: Fixing issue with docs generation (Fixes #9199) (#9200) (Ilya Volodin)
Commits

The new version differs by 6 commits.

  • d65c540 4.6.1
  • 61c845c Build: changelog update for 4.6.1
  • bdec46d Build: avoid process leak when generating website (#9217)
  • cb74b87 Fix: avoid adding globals when an env is used with false (fixes #9202) (#9203)
  • f9b7544 Docs: Correct a typo in generator-star-spacing documentation (#9205)
  • e5c5e83 Build: Fixing issue with docs generation (Fixes #9199) (#9200)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of eslint is breaking the build 🚨

Version 4.11.0 of eslint was just published.

Branch Build failing 🚨
Dependency eslint
Current Version 4.10.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v4.11.0
  • d4557a6 Docs: disallow use of the comma operator using no-restricted-syntax (#9585) (薛定谔的猫)
  • d602f9e Upgrade: espree v3.5.2 (#9611) (Kai Cataldo)
  • 4def876 Chore: avoid handling rules instances in config-validator (#9364) (Teddy Katz)
  • fe5ac7e Chore: fix incorrect comment in safe-emitter.js (#9605) (Teddy Katz)
  • 6672fae Docs: Fixed a typo on lines-between-class-members doc (#9603) (Moinul Hossain)
  • 980ecd3 Chore: Update copyright and license info (#9599) (薛定谔的猫)
  • cc2c7c9 Build: use Node 8 in appveyor (#9595) (薛定谔的猫)
  • 2542f04 Docs: Add missing options for lines-around-comment (#9589) (Clément Fiorio)
  • b6a7490 Build: ensure fuzzer tests get run with npm test (#9590) (Teddy Katz)
  • 1073bc5 Build: remove shelljs-nodecli (refs #9533) (#9588) (Teddy Katz)
  • 7e3bf6a Fix: edge-cases of semi-style (#9560) (Toru Nagashima)
  • e5a37ce Fix: object-curly-newline for flow code (#9458) (Tiddo Langerak)
  • 9064b9c Chore: add equalTokens in ast-utils. (#9500) (薛定谔的猫)
  • b7c5b19 Fix: Correct [object Object] output of error.data. (#9561) (Jonathan Pool)
  • 51c8cf0 Docs: Disambiguate definition of Update tag (#9584) (Jonathan Pool)
  • afc3c75 Docs: clarify what eslint-config-eslint is (#9582) (Teddy Katz)
  • aedae9d Docs: fix spelling in valid-typeof example (#9574) (Maksim Degtyarev)
  • 4c5aaf3 Docs: Fix typo in no-underscore-dangle rule (#9567) (Fabien Lucas)
  • 3623600 Chore: upgrade [email protected] (#9557) (薛定谔的猫)
  • 1b606cd Chore: Remove an indirect dependency on jsonify (#9444) (Rouven Weßling)
  • 4d7d7ab Update: Resolve npm installed formatters (#5900) (#9464) (Tom Erik Støwer)
  • accc490 Fix: Files with no failures get "passing" testcase (#9547) (Samuel Levy)
  • ab0f66d Docs: Add examples to better show rule coverage. (#9548) (Jonathan Pool)
  • 88d2303 Chore: Add object-property-newline tests to increase coverage. (#9553) (Jonathan Pool)
  • 7f37b1c Build: test Node 9 on Travis (#9556) (Teddy Katz)
  • acccfbd Docs: Minor rephrase in no-invalid-this. (#9542) (Francisc)
  • 8f9c0fe Docs: improve id-match usage advice (#9544) (Teddy Katz)
  • a9606a3 Fix: invalid tests with super (fixes #9539) (#9545) (Teddy Katz)
  • 8e1a095 Chore: enable a modified version of multiline-comment-style on codebase (#9452) (Teddy Katz)
  • cb60285 Chore: remove commented test for HTML formatter (#9532) (Teddy Katz)
  • 06b491e Docs: fix duplicate entries in changelog (#9530) (Teddy Katz)
  • 2224733 Chore: use eslint-plugin-rulesdir instead of --rulesdir for self-linting (#9164) (Teddy Katz)
  • 9cf4ebe Docs: add .md to link(for github users) (#9529) (薛定谔的猫)
Commits

The new version differs by 35 commits.

  • 1a9a6a5 4.11.0
  • ef4d268 Build: changelog update for 4.11.0
  • d4557a6 Docs: disallow use of the comma operator using no-restricted-syntax (#9585)
  • d602f9e Upgrade: espree v3.5.2 (#9611)
  • 4def876 Chore: avoid handling rules instances in config-validator (#9364)
  • fe5ac7e Chore: fix incorrect comment in safe-emitter.js (#9605)
  • 6672fae Docs: Fixed a typo on lines-between-class-members doc (#9603)
  • 980ecd3 Chore: Update copyright and license info (#9599)
  • cc2c7c9 Build: use Node 8 in appveyor (#9595)
  • 2542f04 Docs: Add missing options for lines-around-comment (#9589)
  • b6a7490 Build: ensure fuzzer tests get run with npm test (#9590)
  • 1073bc5 Build: remove shelljs-nodecli (refs #9533) (#9588)
  • 7e3bf6a Fix: edge-cases of semi-style (#9560)
  • e5a37ce Fix: object-curly-newline for flow code (#9458)
  • 9064b9c Chore: add equalTokens in ast-utils. (#9500)

There are 35 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

`return` statement formatted with wrong place

function cartesian(a,b, selectorP, res, i, j) {
    res = []
    for (j in b) if(own.call(b, j))
      for (i in a) if(own.call(a, i))
        res.push(concat(a[i], b[j], selectorP))
    return res
  }

After format, the code:

function cartesian(a, b, selectorP, res, i, j) {
    res = [];
    for (j in b) {
      if (own.call(b, j)) for (i in a) {
        if (own.call(a, i)) res.push(concat(a[i], b[j], selectorP));
      }
    }return res;
  }

Remove `debug: true` from babel-preset-env config

Can we consider removing debug: true for babel-preset-env? The debug option produces console output I find to be rather annoying and unhelpful. It gets in the way of the output I actually care about.

This is an example of the console output I get:

babel-preset-env: `DEBUG` option

Using targets:
{
  "android": "30",
  "chrome": "35",
  "edge": "14",
  "explorer": "9",
  "firefox": "52",
  "safari": "8",
  "ucandroid": "1"
}

Modules transform: false

Using plugins:
  check-es2015-constants {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-arrow-functions {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-block-scoped-functions {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-block-scoping {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-classes {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-computed-properties {"android":"30","chrome":"35","explorer":"9","ucandroid":"1"}
  transform-es2015-destructuring {"android":"30","chrome":"35","edge":"14","explorer":"9","firefox":"52","safari":"8","ucandroid":"1"}
  transform-es2015-duplicate-keys {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-for-of {"android":"30","chrome":"35","edge":"14","explorer":"9","firefox":"52","safari":"8","ucandroid":"1"}
  transform-es2015-function-name {"android":"30","chrome":"35","edge":"14","explorer":"9","firefox":"52","safari":"8","ucandroid":"1"}
  transform-es2015-literals {"android":"30","chrome":"35","explorer":"9","firefox":"52","safari":"8","ucandroid":"1"}
  transform-es2015-object-super {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-parameters {"android":"30","chrome":"35","explorer":"9","firefox":"52","safari":"8","ucandroid":"1"}
  transform-es2015-shorthand-properties {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-spread {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-sticky-regex {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-typeof-symbol {"chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-es2015-unicode-regex {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  transform-exponentiation-operator {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}
  syntax-trailing-function-commas {"android":"30","chrome":"35","explorer":"9","safari":"8","ucandroid":"1"}

The debug option is false by default for babel-preset-env, but we are explicitly enabling it. Are there reservations against leaving it disabled by default?

@goatslacker

about template literals

Looking at the code it seems that it is excluded, but later it's added again in the plugins array.

Why? I definitely read it carefully few times.

BUG : Warning import with version 4.0.1

Hello, I have an issue with the latest version of babel-preset-airbnb (v4.0.1) : When I compile with webpack I have this warning :

WARNING in ./path/to/ItemFile.jsx 112:21-27
"export 'create' was not found in './path/to/react-doka-4.6.1/lib/doka.esm.min'

Here is how I import the function :

import { create } from './path/to/react-doka-4.6.1/lib/doka.esm.min';

But in doka.esm.min I have an export :

...
exports.create = create;

This problem does not occurs with version 3.3.2. Is it normal ?

Thx for all.

An in-range update of eslint-plugin-import is breaking the build 🚨

Version 2.3.0 of eslint-plugin-import just got published.

Branch Build failing 🚨
Dependency eslint-plugin-import
Current Version 2.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-import is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 46 commits.

  • b79e083 Merge pull request #837 from benmosher/release-2.3.0
  • 74425a2 changelog update for 2.3.0
  • 1377f55 bump v2.3.0
  • 2efc41a fix null pointer exception (#717) (#797)
  • 0fb592e Add support to specify the package.json (#685)
  • 2cc9768 Add test for flow type export (#835)
  • bd0e5e3 Merge pull request #821 from smably/patch-1
  • 412e518 Clarify docs for glob arrays
  • 106740f chore(package): update typescript-eslint-parser to version 2.1.0 (#790)
  • 6288cf9 chore(package): update babel-register to version 6.24.1 (#796)
  • 2e9eea6 newline-after-import test syntax fails
  • c9f10e8 extensions test fixes, attempt 2
  • 861765f fix babel syntax errors in extensions tests
  • 82f796c chore(package): update cross-env to version 4.0.0 (#783)
  • 98e7048 Merge pull request #757 from gmathieu/fix-default-keyword

There are 46 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Usage with @babel/polyfill

I would like to use @babel/polyfill along with this preset. The docs for @babel/preset-env talk about the useBuiltIns option, which enables you to use @babel/polyfill in ways that prevent importing the entire polyfill. Is there any way to access useBuiltIns when using this preset?

Thanks!

ReferenceError: Unknown plugin "babel-plugin-transform-strict-mode"

Hi,

When i m trying to build my application it breaks because of the following issue from your package.

ReferenceError: Unknown plugin "babel-plugin-transform-strict-mode" specified in "/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-preset-airbnb/index.js" at 1, attempted to resolve relative to "/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-preset-airbnb" (While processing preset: "/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-preset-airbnb/index.js")
error	16-Jul-2018 05:52:35	    at /usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
error	16-Jul-2018 05:52:35	    at Array.map (native)
error	16-Jul-2018 05:52:35	    at Function.normalisePlugins (/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
error	16-Jul-2018 05:52:35	    at OptionManager.mergeOptions (/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
error	16-Jul-2018 05:52:35	    at /usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
error	16-Jul-2018 05:52:35	    at /usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
error	16-Jul-2018 05:52:35	    at Array.map (native)
error	16-Jul-2018 05:52:35	    at OptionManager.resolvePresets (/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
error	16-Jul-2018 05:52:35	    at OptionManager.mergePresets (/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
error	16-Jul-2018 05:52:35	    at OptionManager.mergeOptions (/usr/local/bamboo/agent3-home/xml-data/build-dir/APP/MyApplication/Content/oppDash/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)

I think its because of your changes yesterday. Can you help me resolve this issue?

Breaking changes in this project

👋 After upgrading from v 2.2.3 to v2.3.3 (the versions in between are not published on NPM), generators stopped being transpiled.

I would consider this to be a breaking change (e.g. if the resulting code after upgrading from 2.2.3 to 2.3.3 is passed to uglify, it will throw errors, IE11 will throw because it doesn't understand generators, etc). The issue is present in 2.4.0 too.

It would be useful to consumers if you could clarify what you consider to be breaking changes for this project so people know what semver ranges are safe to use (e.g. ^2.0.0 vs ~2.2.0 or 2.2.3)

webpack (3) return with UglifyJS error

When using webpack with options -p or plugin UglifyJsPlugin, I got this

ERROR in someBundle.someHash.js from UglifyJs
Unexpected token: keyword (function) [someBundle.someHash.js:31983,14]

I have tried to update babel config with different presets and it work, I have that error when I only use babel-preset-airbnb. And I don't think using babel-preset-es2015 or babel-preset-env along side is a good solution.

ImportDeclaration / ExportDeclaration Conflict

Problem is resolved if ImportDeclaration and ExportDeclaration options are removed.

Atom Linter warning output

Configuration for rule "object-curly-newline" is invalid: Value {"ObjectExpression":{"minProperties":4,"multiline":true,"consistent":true},"ObjectPattern":{"minProperties":4,"multiline":true,"consistent":true},"ImportDeclaration":{"minProperties":4,"multiline":true,"consistent":true},"ExportDeclaration":{"minProperties":4,"multiline":true,"consistent":true}} should be equal to one of the allowed values. Value {"ObjectExpression":{"minProperties":4,"multiline":true,"consistent":true},"ObjectPattern":{"minProperties":4,"multiline":true,"consistent":true},"ImportDeclaration":{"minProperties":4,"multiline":true,"consistent":true},"ExportDeclaration":{"minProperties":4,"multiline":true,"consistent":true}} should NOT have additional properties. Value {"ObjectExpression":{"minProperties":4,"multiline":true,"consistent":true},"ObjectPattern":{"minProperties":4,"multiline":true,"consistent":true},"ImportDeclaration":{"minProperties":4,"multiline":true,"consistent":true},"ExportDeclaration":{"minProperties":4,"multiline":true,"consistent":true}} should match exactly one schema in oneOf. Value {"ObjectExpression":{"minProperties":4,"multiline":true,"consistent":true},"ObjectPattern":{"minProperties":4,"multiline":true,"consistent":true},"ImportDeclaration":{"minProperties":4,"multiline":true,"consistent":true},"ExportDeclaration":{"minProperties":4,"multiline":true,"consistent":true}} should NOT have additional properties. Value {"ObjectExpression":{"minProperties":4,"multiline":true,"consistent":true},"ObjectPattern":{"minProperties":4,"multiline":true,"consistent":true},"ImportDeclaration":{"minProperties":4,"multiline":true,"consistent":true},"ExportDeclaration":{"minProperties":4,"multiline":true,"consistent":true}} should match exactly one schema in oneOf.

Referenced from: /Users/user/Documents/project/node_modules/eslint-config-airbnb-base/index.js

Error: Cannot find module '@babel/runtime/helpers/interopRequireWildcard'

When running babel-node with this preset, I am encountering the following error and call stack:

internal/modules/cjs/loader.js:628
    throw err;
    ^

Error: Cannot find module '@babel/runtime/helpers/interopRequireWildcard'
Require stack:
- /Users/pauljaworski/Projects/ponto-api/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/pauljaworski/Projects/ponto-api/src/index.js:3:31)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Module._compile (/Users/pauljaworski/Projects/ponto-api/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Object.newLoader [as .js] (/Users/pauljaworski/Projects/ponto-api/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:643:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/pauljaworski/Projects/ponto-api/src/index.js' ]
}

The issue goes away when I switch to @babel/preset-env, so I'm assuming it's coming from this preset. Happy to provide more information if needed. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.