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

import prettierPluginLintMd, { PARSER_NAME } from 'prettier-plugin-lint-md'; 之后报错 #6

Open
yanglbme opened this issue Aug 30, 2024 · 4 comments

Comments

@yanglbme
Copy link

import prettierPluginLintMd, { PARSER_NAME } from 'prettier-plugin-lint-md';

之后,启动项目,报了如下错误,看看是什么问题

node.js:158 Uncaught TypeError: tty.isatty is not a function
at Function.useColors (node.js:158:1)
at createDebug (common.js:117:1)
at ./node_modules/.pnpm/[email protected]/node_modules/micromark/dev/lib/create-tokenizer.js (create-tokenizer.js:35:15)
at webpack_require (bootstrap:19:1)
at ./node_modules/.pnpm/[email protected]/node_modules/micromark/dev/lib/parse.js (text.js:225:1)
at webpack_require (bootstrap:19:1)
at ./node_modules/.pnpm/[email protected]/node_modules/mdast-util-from-markdown/dev/lib/index.js (index.js:253:1)
at webpack_require (bootstrap:19:1)
at ./node_modules/.pnpm/[email protected]/node_modules/remark-parse/lib/index.js (index.js:3:16)
at webpack_require (bootstrap:19:1)

@yanglbme
Copy link
Author

https://github.com/doocs/md/pull/371/files

在这里 pr 基础上,加了这个 plugin 就报错

@bosens-China
Copy link
Member

从相关信息并没有看到是prettier本身的问题,可以创建一个最小的仓库我来调试一下。

@yanglbme
Copy link
Author

你方便 clone 一下我们主分支的代码吗?我们想在目前的基础上,加上 lint-md

https://github.com/doocs/md/blob/main/src/utils/index.js#L119

@bosens-China
Copy link
Member

抱歉这块我只能定位当前插件的错误,如果你能复现我可以帮忙解决,但是从上述的看到报错信息,推测大概是由于
create-tokenizer.js、micromark/dev/lib/parse.js等引起的。
另外prettier更多是结合ide而不涉及到webpack的dev和build,所以你需要更明确一下错误来源

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