airbnb / babel-preset-airbnb Goto Github PK
View Code? Open in Web Editor NEWA babel preset for transforming your JavaScript for Airbnb
License: MIT License
A babel preset for transforming your JavaScript for Airbnb
License: MIT License
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!
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?
The ESXXXX presets will be deprecated as of Babel 7. The replacement is babel-preset-env.
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.
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!
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.
The README states that this preset contains transformation for all stage 3 syntax, but I noticed that @babel/plugin-proposal-class-properties
, for example, is not included here. Is this intentional, or has it just not been added yet?
Sorry for the second issue in one day, and thanks!
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 💪
false
(fixes #9202) (#9203) (Teddy Katz)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
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
I'm having a lint fail in CI using the Airbnb but only with Node 6. Some investigation yielded babel/babel-eslint#605 and babel/babel#7654.
Is it possible to force this dependency to use a different version of the babel suite while using airbnb-base
? I'm not sure how to solve this otherwise, but completely open to all help and suggestions. Thank you.
devDependency
@babel/core was updated from 7.1.1
to 7.1.2
.dependency
@babel/plugin-transform-exponentiation-operator was updated from 7.0.0
to 7.1.0
.dependency
@babel/plugin-transform-property-mutators was updated from 7.0.0
to 7.1.0
.dependency
@babel/preset-env was updated from 7.0.0
to 7.1.0
.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.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
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 💪
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
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.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.
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 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
👋 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
)
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
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?
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.
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;
}
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.
We want to use the "browserslist" and configure this in package.json is from evilmartains:
https://github.com/ai/browserslist
This is supported in babel 7.0
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.
lines-around-comment
(#9589) (Clément Fiorio)npm test
(#9590) (Teddy Katz)no-invalid-this
. (#9542) (Francisc)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
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.