Conversation
Prettier takes code as input and spits out the same code with a prettier format. It drops most the original styling and formats the code from its syntax tree, the output style is always consistent. The `npm run lint` task asserts that all of the `.js` files match both the current eslint rules and are formatted correctly according to Prettier. It is necessary to run Prettier to reformat any new changes in-place before committing. Run `npm run format` before committing to reformat any changed code, _or_ configure your editor to automatically run Prettier as files are changed: **Sublime Text 3:** - Install [JsPrettier](https://github.com/jonlabelle/SublimeJsPrettier) (there is not need to install `prettier` globally, the local dependency will be used) - Configure JsPrettier to auto format files on save: ```json // ~/Library/Application Support/Sublime Text 3/Packages/User/JsPrettier.sublime-settings { "auto_format_on_save": true, "auto_format_on_save_excludes": [ "*/package.json", "*/package-lock.json", ] } ``` **Atom:** - Install [Prettier for Atom](https://atom.io/packages/prettier-atom) - Enable "format on save" (Packages → Prettier → Toggle Format on Save)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prettier takes code as input and spits out the same code with a prettier format.
It drops most the original styling and formats the code from its syntax tree, the output style is always consistent.
The
npm run linttask asserts that all of the.jsfiles match both the current eslint rules and are formatted correctly according to Prettier. It is necessary to run Prettier to reformat any new changes in-place before committing.Run
npm run formatbefore committing to reformat any changed code, or configure your editor to automatically run Prettier as files are changed:Sublime Text 3:
prettierglobally, the local dependency will be used)Atom: