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: Fails to parse md files #7

Closed
jantimon opened this issue Jan 15, 2019 · 5 comments
Closed

prettier: Fails to parse md files #7

jantimon opened this issue Jan 15, 2019 · 5 comments

Comments

@jantimon
Copy link
Contributor

The default parser is set to typescript without any overwrite for md files.

https://github.com/namics/frontend-defaults/blob/cc10f74c37444cafb0d27c6c206be5b375bc0df6/codequality/prettier/index.js#L11

Unfortunately this causes the following error:

SyntaxError: Invalid character. (1:1)
> 1 | # Hello World
    | ^
  2 | 
  3 | Lorem ipsum
  4 | 
at e (node_modules/prettier/parser-typescript.js:1:329)
@smollweide
Copy link
Contributor

Hi Jan,
use the recommended config

"prettier": "prettier --write \"**/*.*(js|jsx|ts|tsx|json)\""

md should not be prettified

@ernscht
Copy link
Member

ernscht commented Jan 15, 2019

This is well known. There is also no configuration for css and scss.
This is because we couldn't find a good configuration for Markdown and css/scss.
The way we go for now ist to restrict the filetypes for prettifying:

"prettier": "prettier --write \"**/*.*(js|jsx|ts|tsx|json)\"",

@jantimon
Copy link
Contributor Author

unfortunately pretty-quick does not allow to use a minimatch.

Should we add **/*.scss **/*.css and **/*.md to the ignore?

@ernscht
Copy link
Member

ernscht commented Jan 15, 2019

we don't use pretty-quick til now - why you want to use it?

@jantimon
Copy link
Contributor Author

It solves #6 and is the recommended prettier husky integration according to the getting started section of https://prettier.io/

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

No branches or pull requests

3 participants