Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion parser/ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
'use strict';

const babylon = require('@babel/parser');
const options = require('./tsOptions');
const baseOptions = require('./tsOptions');
const options = {
...baseOptions,
plugins: baseOptions.plugins.map(plugin =>
Array.isArray(plugin) && plugin[0] === 'typescript'
? ['typescript', { disallowAmbiguousJSXLikeChildren: true }]
: plugin
),
};

/**
* Doesn't accept custom options because babylon should be used directly in
Expand Down
15 changes: 15 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ function match(path, filter) {

const plugins = [];

/**
* Printer configuration for TypeScript type members.
* This ensures proper separator handling when TSPropertySignature nodes are removed.
*/
const printerConfig = {
printer: {
_TYPESCRIPT: {
TSPropertySignature: {
trailingSeparator: 'always',
leadingSeparator: 'never',
},
},
},
};

/**
* Utility function for registering plugins.
*
Expand Down