* Use same print width for range formatting as normal formatting.
Fixes an issue were a file would end up formatted differently
with ranged formatting (--range-start & --range-end) versus
normal whole file formatting.
* Document range bugfix in changelog.
* Fix closure compiler type casts
This fixes casts when they are followed by a closing parenthesis, eg:
```js
foo( /** @type {!Array} */(arrOrString).length );
```
The old code would see the `CallExpresion`'s closing `)` and assume the typecast belonged to the `MemberExpression`, not the `arrOrString` `Identifier`.
This would be easier to accomplish if every AST would tell us if the expression were parenthesized. If they did, we could check that the node were parenthesized and either it or an ancestor has a typecast, stopping when we find an ancestor is itself parenthesized.
* More tests, and changelog
* Fix while loop
* Update changelog
* Update CHANGELOG.unreleased.md
* Use babel's parenthesized information
* Cleanup call
Fragment variables are an experimental extension to GraphQL schema.
Formatting should follow the same rules as formatting an OperationDefinition node,
hence code is the same.
* docs: Add simplified installation instructions for lint-staged
Currently, to install and configure lint-staged you'd need to manually install all packaged and modify the `package.json`.
With `mrm` it's done automatically depending on what version of Prettier is installed and specified in project's dependencies.
* docs: Update according to feedback
* Update docs/precommit.md
Co-Authored-By: okonet <okonet@users.noreply.github.com>
Another possible option is `if it gets`
<!-- Please provide a brief summary of your changes: -->
<!-- Please ensure you’ve done all of these things (if applicable). -->
<!-- You can replace the `[ ]` with `[x]` to mark each task as done. -->
- [ ] I’ve added tests to confirm my change works.
- [ ] (If changing the API or CLI) I’ve documented the changes I’ve made (in the `docs/` directory)
- [ ] (If not an internal change) I’ve added my changes to the `CHANGELOG.unreleased.md` file following the template.
- [x] I’ve read the [contributing guidelines](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md).
**✨[Try the playground for this PR](https://prettier.io/playground-redirect)✨**