Skip to content

Commit

Permalink
refactor: 🌟set jsx options to true, while its empty
Browse files Browse the repository at this point in the history
  • Loading branch information
TyrealHu committed Oct 18, 2023
1 parent ed96de2 commit 77e26cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions __test__/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import * as acorn from 'acorn'
import tsPlugin from '../src'

export const Parser = acorn.Parser.extend(tsPlugin({
jsx: {
allowNamespaces: true
}
}))
export const Parser = acorn.Parser.extend(tsPlugin())

export const DtsParser = acorn.Parser.extend(tsPlugin({
dts: true
Expand Down
8 changes: 4 additions & 4 deletions src/extentions/jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export default function generateJsxParser(
const tok = acornTypeScript.tokTypes
const isNewLine = acorn.isNewLine
const isIdentifierChar = acorn.isIdentifierChar
const options = {
allowNamespaces: (Boolean(jsxOptions?.allowNamespaces)) !== false,
allowNamespacedObjects: !!(jsxOptions?.allowNamespacedObjects)
}
const options = Object.assign({
allowNamespaces: true,
allowNamespacedObjects: true
}, jsxOptions || {})

return class JsxParser extends Parser {
// Reads inline JSX contents token.
Expand Down

0 comments on commit 77e26cd

Please sign in to comment.