Skip to content

Commit

Permalink
Sort babel plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
birkskyum committed Aug 7, 2022
1 parent 7e17203 commit 5d66953
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/parsers/parse_to_ast.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
import babelParser from '@babel/parser';
import path from 'path';

const TYPESCRIPT_EXTS = {
'.ts': ['typescript'],
'.tsx': ['typescript', 'jsx']
};

// this list is roughly the same as the one in prettier
// https://github.com/prettier/prettier/blob/24d39a906834cf449304dc684b280a5ca9a0a6d7/src/language-js/parser-babel.js#L23
export const standardBabelParserPlugins = [
'doExpressions',
'classPrivateMethods',
'classPrivateProperties',
'classProperties',
'classStaticBlock',
'decimal',
['decorators', { decoratorsBeforeExport: false }],
'doExpressions',
'exportDefaultFrom',
'functionBind',
'functionSent',
'classPrivateProperties',
'throwExpressions',
'classPrivateMethods',
'v8intrinsic',
'importAssertions',
'moduleBlocks',
'moduleStringNames',
'partialApplication',
['decorators', { decoratorsBeforeExport: false }],
['pipelineOperator', { proposal: 'minimal' }],
'privateIn',
'importAssertions',
['recordAndTuple', { syntaxType: 'hash' }],
'decimal',
'moduleStringNames',
'classStaticBlock',
'moduleBlocks',

['pipelineOperator', { proposal: 'minimal' }]
'throwExpressions',
'v8intrinsic'
];

const TYPESCRIPT_EXTS = {
'.ts': ['typescript'],
'.tsx': ['typescript', 'jsx']
};

function getParserOpts(file) {
return {
allowImportExportEverywhere: true,
Expand Down

0 comments on commit 5d66953

Please sign in to comment.