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

prettier formatter error: find no parser #103

Closed
liuyinz opened this issue Jun 13, 2022 · 0 comments · Fixed by #107
Closed

prettier formatter error: find no parser #103

liuyinz opened this issue Jun 13, 2022 · 0 comments · Fixed by #107

Comments

@liuyinz
Copy link

liuyinz commented Jun 13, 2022

I want to format a file name: .yamllint, it is definitely a yaml file. However, the prettier format
returns find no parser error even if I have set the major mode to yaml-mode.

It seems prettier select parser according to file extension like .vue, .json or whatever

# prettier --help
--parser <flow|babel|babel-flow|babel-ts|typescript|acorn|espree|meriyah|css|less|scss|json|json5|json-stringify|graphql|markdown|mdx|vue|yaml|glimmer|html|angular|lwc|toml>
(prettier . (npx "prettier" "--stdin-filepath" filepath))

I notice that prettier format doesn't include the --parser= argument, could we map
(MAJOR_MODE . PARSER) by force or select parser according to file extension first and then the major-mode ?

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

Successfully merging a pull request may close this issue.

1 participant