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

Using this with prettier #101

Closed
simlu opened this issue Oct 30, 2018 · 6 comments
Closed

Using this with prettier #101

simlu opened this issue Oct 30, 2018 · 6 comments

Comments

@simlu
Copy link
Contributor

simlu commented Oct 30, 2018

Using this in combination with eslint-plugin-prettier.

It appears since the linebreaks are stripped, we can't satisfy prettier?

For a code block

\`\`\`js
const a = "";

\`\`\`

I always get the error:

error Insert "⏎" prettier/prettier

Wondering if we can just fix this by adding a new-line before checking. What is the "correct" solution here?

Relevant:
https://github.com/eslint/eslint-plugin-markdown/blob/master/lib/processor.js#L13

@simlu
Copy link
Contributor Author

simlu commented Oct 30, 2018

Opened a pr adding in the line break. Would appreciate timely feedback since this is blocking for us.

@platinumazure
Copy link
Member

Is prettier even really meant to work with code blocks (as opposed to files)? I would say you should just use config overrides to disable prettier/prettier from markdown files, at least as a short-term solution.

@simlu
Copy link
Contributor Author

simlu commented Oct 30, 2018

@platinumazure We lose so much by disabling that.

(1) Prettier is designed to work on markdown syntax. So that would be completely disabled

(2) Prettier replaces eslint formatting. So to use prettier one needs to disable eslint formatting rules. That means we would effectively disable all formatting checks for code blocks in markdown.

Hence that is not really an option.

@platinumazure
Copy link
Member

@simlu Okay, thanks for explaining.

In that case, I'll ask you to please remember that this project, like many open source projects, is maintained on a volunteer basis, and so things will not always move at the speed you want to. Please give the maintainer a few days to evaluate this. Thanks!

@btmills
Copy link
Member

btmills commented Nov 6, 2018

Thanks for your patience and putting the pull request together, @simlu! I just released v1.0.0-rc.1 that included your change.

@simlu
Copy link
Contributor Author

simlu commented Nov 6, 2018

Sweet! Thank you very much!

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

Successfully merging a pull request may close this issue.

3 participants