Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue options.d.ts cannot be processed #121

Open
olleharstedt opened this issue Nov 3, 2020 · 3 comments
Open

Vue options.d.ts cannot be processed #121

olleharstedt opened this issue Nov 3, 2020 · 3 comments

Comments

@olleharstedt
Copy link

Run

flowgen options.d.ts

Excpetion:

Parsing options
{ SyntaxError: Unexpected token, expected ";" (142:3)
140 | [key: string]: boolean,...
141 | },...

142 | } export type DirectiveFunction = (
| ^
143 | el: HTMLElement,
144 | binding: DirectiveBinding,
145 | vnode: VNode,
at t (/usr/local/lib/node_modules/flowgen/node_modules/prettier/parser-babel.js:1:317)
at Object.He [as parse] (/usr/local/lib/node_modules/flowgen/node_modules/prettier/parser-babel.js:1:291098)
at Object.parse (/usr/local/lib/node_modules/flowgen/node_modules/prettier/index.js:13575:19)
at coreFormat (/usr/local/lib/node_modules/flowgen/node_modules/prettier/index.js:14851:25)
at format (/usr/local/lib/node_modules/flowgen/node_modules/prettier/index.js:15073:14)
at formatWithCursor (/usr/local/lib/node_modules/flowgen/node_modules/prettier/index.js:15090:12)
at args (/usr/local/lib/node_modules/flowgen/node_modules/prettier/index.js:54691:12)
at Object.format (/usr/local/lib/node_modules/flowgen/node_modules/prettier/index.js:54711:12)
at beautify (/usr/local/lib/node_modules/flowgen/lib/cli/beautifier.js:11:28)
at outputFile (/usr/local/lib/node_modules/flowgen/lib/cli/runner.js:40:38)
loc: { start: { line: 142, column: 3 } },
codeFrame:
'\u001b[0m \u001b[90m 140 | \u001b[39m[key\u001b[33m:\u001b[39m string]\u001b[33m:\u001b[39m boolean\u001b[33m,\u001b[39m\u001b[33m...\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 141 | \u001b[39m}\u001b[33m,\u001b[39m\u001b[33m...\u001b[39m\u001b[0m\n\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 142 | \u001b[39m} \u001b[36mexport\u001b[39m type \u001b[33mDirectiveFunction\u001b[39m \u001b[33m=\u001b[39m (\u001b[0m\n\u001b[0m \u001b[90m | \u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 143 | \u001b[39mel\u001b[33m:\u001b[39m \u001b[33mHTMLElement\u001b[39m\u001b[33m,\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 144 | \u001b[39mbinding\u001b[33m:\u001b[39m \u001b[33mDirectiveBinding\u001b[39m\u001b[33m,\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 145 | \u001b[39mvnode\u001b[33m:\u001b[39m \u001b[33mVNode\u001b[39m\u001b[33m,\u001b[39m\u001b[0m' }

https://github.com/vuejs/vue/blob/dev/types/options.d.ts

@orta
Copy link
Collaborator

orta commented Nov 4, 2020

Cool, want to make a test case and try give it a fix?

@olleharstedt
Copy link
Author

Maybe. 😅 Will see how much time I have.

@olleharstedt
Copy link
Author

Cool, want to make a test case and try give it a fix?

Did you create the parser yourself, or is it a lib?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants