Skip to content

Commit

Permalink
Add allowDeclareFields but commented for now
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalduez committed Sep 25, 2024
1 parent 7fa6584 commit 1d6c378
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const syntaxHermesParser = require('babel-plugin-syntax-hermes-parser');
/**
* 1. Ensure all helpers are imported instead of inlined.
* See https://github.com/babel/babel/issues/9297#issuecomment-453750049
* 2. Will set as default from Babel 8.
*/

module.exports = declarePreset((api, options = {}) => {
Expand All @@ -40,14 +41,18 @@ module.exports = declarePreset((api, options = {}) => {
let { parser = 'babel', ...envOptions } = options;

let envOpts = {
bugfixes: true,
bugfixes: true, // 2
shippedProposals: true,
...envOptions,
};

let reactOpts = {
useSpread: true,
runtime: 'automatic',
useSpread: true, // 2
runtime: 'automatic', // 2
};

let flowOpts = {
// allowDeclareFields: true, // 2
};

let runtimeOpts = {
Expand All @@ -57,7 +62,11 @@ module.exports = declarePreset((api, options = {}) => {
version: '7.25.0', // 1
};

let presets = [[presetEnv, envOpts], [presetReact, reactOpts], presetFlow];
let presets = [
[presetEnv, envOpts],
[presetReact, reactOpts],
[presetFlow, flowOpts],
];

let plugins = [
...(parser === 'hermes' ? [syntaxHermesParser] : []),
Expand Down

0 comments on commit 1d6c378

Please sign in to comment.