Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check which es2015 feature babel-preset-react-native dose not have
const rnKeys = [ 'babel-plugin-react-transform',
'babel-plugin-syntax-async-functions',
'babel-plugin-syntax-class-properties',
'babel-plugin-syntax-trailing-function-commas',
'babel-plugin-transform-class-properties',
'babel-plugin-transform-es2015-function-name',
'babel-plugin-transform-es2015-arrow-functions',
'babel-plugin-transform-es2015-block-scoping',
'babel-plugin-transform-es2015-classes',
'babel-plugin-transform-es2015-computed-properties',
'babel-plugin-check-es2015-constants',
'babel-plugin-transform-es2015-destructuring',
'babel-plugin-transform-es2015-modules-commonjs',
'babel-plugin-transform-es2015-parameters',
'babel-plugin-transform-es2015-shorthand-properties',
'babel-plugin-transform-es2015-spread',
'babel-plugin-transform-es2015-template-literals',
'babel-plugin-transform-es2015-literals',
'babel-plugin-transform-flow-strip-types',
'babel-plugin-transform-object-assign',
'babel-plugin-transform-object-rest-spread',
'babel-plugin-transform-react-display-name',
'babel-plugin-transform-react-jsx-source',
'babel-plugin-transform-react-jsx',
'babel-plugin-transform-regenerator',
'babel-plugin-transform-es2015-for-of' ];
const es2015Keys = [ 'babel-plugin-check-es2015-constants',
'babel-plugin-transform-es2015-arrow-functions',
'babel-plugin-transform-es2015-block-scoped-functions',
'babel-plugin-transform-es2015-block-scoping',
'babel-plugin-transform-es2015-classes',
'babel-plugin-transform-es2015-computed-properties',
'babel-plugin-transform-es2015-destructuring',
'babel-plugin-transform-es2015-duplicate-keys',
'babel-plugin-transform-es2015-for-of',
'babel-plugin-transform-es2015-function-name',
'babel-plugin-transform-es2015-literals',
'babel-plugin-transform-es2015-modules-amd',
'babel-plugin-transform-es2015-modules-commonjs',
'babel-plugin-transform-es2015-modules-systemjs',
'babel-plugin-transform-es2015-modules-umd',
'babel-plugin-transform-es2015-object-super',
'babel-plugin-transform-es2015-parameters',
'babel-plugin-transform-es2015-shorthand-properties',
'babel-plugin-transform-es2015-spread',
'babel-plugin-transform-es2015-sticky-regex',
'babel-plugin-transform-es2015-template-literals',
'babel-plugin-transform-es2015-typeof-symbol',
'babel-plugin-transform-es2015-unicode-regex',
'babel-plugin-transform-regenerator' ];
es2015Keys.forEach(aPlugin => {
if(!rnKeys.includes(aPlugin)) {
console.warn(`Missing ES2015 feature! ${aPlugin}`);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment