Skip to content

Commit

Permalink
fix(package): upgrade babel to rc.2
Browse files Browse the repository at this point in the history
This version requires a new option to be passed to the decorators plugin to determine where decorators go with respect to the `export` keyword.  See tc39/proposal-decorators#69 for more information.
  • Loading branch information
eventualbuddha committed Aug 24, 2018
1 parent 8eeb86b commit bfd279c
Show file tree
Hide file tree
Showing 3 changed files with 474 additions and 647 deletions.
8 changes: 5 additions & 3 deletions src/AllSyntaxPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { extname } from 'path';
import { BabelOptions, ParseOptions } from './BabelPluginTypes';
import { TypeScriptExtensions } from './extensions';

const BASIC_PLUGINS = [
const BASIC_PLUGINS: Array<string | [string, object]> = [
'jsx',
'asyncGenerators',
'classProperties',
Expand All @@ -13,10 +13,12 @@ const BASIC_PLUGINS = [
'functionSent',
'objectRestSpread',
'dynamicImport',
'decorators'
['decorators', { decoratorsBeforeExport: true }]
];

function pluginsForFilename(filename: string): Array<string> {
function pluginsForFilename(
filename: string
): Array<string | [string, object]> {
let isTypeScript = TypeScriptExtensions.has(extname(filename));

return isTypeScript
Expand Down
2 changes: 1 addition & 1 deletion src/BabelPluginTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ParseOptions {
allowImportExportEverywhere?: boolean;
allowReturnOutsideFunction?: boolean;
allowSuperOutsideMethod?: boolean;
plugins?: Array<string>;
plugins?: Array<string | [string, object]>;
}
export type AST = object;

Expand Down
Loading

0 comments on commit bfd279c

Please sign in to comment.