Repository navigation
chore: setup markdown formatting - #3224
Conversation
| additional parsers, like this: | ||
| `run_spec(__dirname, { trailingComma: "es5" }, ["babylon"]);` | ||
| additional parsers, like this: `run_spec(__dirname, { trailingComma: "es5" }, | ||
| ["babylon"]);` |
There was a problem hiding this comment.
Should we disable the break in inlineCode? though it's breakable there.
There was a problem hiding this comment.
I personally would not break
| "test:dist": "cross-env NODE_ENV=production yarn test", | ||
| "test-integration": "jest tests_integration", | ||
| "lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter", | ||
| "lint-docs": "prettylint {.,docs,website}/*.md", |
There was a problem hiding this comment.
Would be really good if we could run --fix and auto-commit changes. Because if people contribute via GitHub UI we don't want the build to fail.
There was a problem hiding this comment.
The auto-commit is available but it's dangerous since we'll need to expose our token to PR branches in the Travis, an alternative would be to enable the --no-prose-wrap option to reduce the possibility of linting errors.
EDIT: or setup some webhooks I guess.
| prettier.resolveConfig(filePath).then(options => { | ||
| const formatted = prettier.format(text, options); | ||
| }) | ||
| }); |
c6bd230 to
102e751
Compare
102e751 to
6dba903
Compare
|
Auto commit in PRs might be a bit confusing for users, but I like the auto-fix idea. Perhaps it should be in follow up PRs after commit? In #238 someone metioned https://github.com/GordyD/prettier-master We could work on that |
I prefer Option 1 personally but Option 2 is also fine to me. The Option 3 is too expensive. What do you think? |
|
@vjeux you may have some thoughts on this. |
|
Just realized if we choose Option 2 and there're some ASI issues in the code block or we do not want to format some code blocks but forgot to add |
|
What about just failing the test if the format is wrong.. without committing anything.. by doing so people could change/fix manually if they are willing to.. otherwise someone can edit or run the --fix on top of it before merging.. |
|
I've always found the 80 column enforcement of emails and markdown files such a stupid thing. It's wayyy harder to write and the benefits are very small, nowadays most of the places where they are displayed have a way to do word-wrap. If there are some that don't, then I believe that they should be fixed, rather than pushing a worse editing experience on everyone. Note that code is a different beast. In order to word wrap code you neee to be able to parse the language, so only a complex and language aware tool like prettier can do it. Also there isn't a clear single way to do it. But for markdown prose, it's just a flat list of characters. A good example is writing github comments, it's not expected to fit 80 columns: you don't even have a monospace font nor a column marker. My 2 cents :) |
| * Parenthesize function expressions in expression position (#941) | ||
| * update the README to add a pre-commit hook (#944) | ||
| * Fix #951: properly parenthesize ** expressions (#952) | ||
| * Fix #951: properly parenthesize \** expressions (#952) |
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "proseWrap": false | |||
| } | |||
There was a problem hiding this comment.
Rename as prettier.json since .prettierrc will cause --find-config-path tests to fail.
There was a problem hiding this comment.
We should fix the tests (maybe mock impl for existsSync())?
f2e66dd to
e236a90
Compare
e236a90 to
ae3a217
Compare
|
This one is good to merge, right? |
|
If there's no further comment, it should be good to merge. |
* master: Don't add trailing comma after object rest spread in TypeScript (prettier#3313) fix(cli): respect `--ignore-path` when using `--stdin-filepath` (prettier#3309) Fix infinite recursion in playground (prettier#3305) chore: setup markdown formatting (prettier#3224)
Re-apply #3022
This PR also update prettier to v1.8.2.