Deprecate jsxBracketSameLine option in favour of multi-language bracketSameLine option (#11006)
* deprecate jsxBracketSameLine in favour of multi-language angleBracketSameLine option * update docs and snapshots * update tests to to make them more reviewable * Rewrite angular tests * Rewrite html tests * Rewrite vue tests * Restore unnecessary changes in jsx * Fix file location * Test both `true` and `false` * Revert changes in markdown * Run tests on all js parsers * Improve html test * fix changelog comment * move bracketSameLine to common options * mark jsxBracketSameLine as deprecated * Update changelog_unreleased/html/11006.md Co-authored-by: fisker Cheung <lionkay@gmail.com> * Update 11006.md * fix tests by removing `jsxBracketSameLine` `default` property * fix style * Revert docs under website dir * Add tests for deprecated options * Fix lint problems Co-authored-by: fisker Cheung <lionkay@gmail.com> Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
This commit is contained in:
37 files changed
+1207
-70
No files matched your search
+38
-1
@@ -135,7 +135,44 @@ Valid options:
|
||||
| ------- | ---------------------- | ------------------------ |
|
||||
| `true` | `--no-bracket-spacing` | `bracketSpacing: <bool>` |
|
||||
|
||||
## JSX Brackets
|
||||
## Bracket Line
|
||||
|
||||
Put the `>` of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being alone on the next line (does not apply to self closing elements).
|
||||
|
||||
Valid options:
|
||||
|
||||
- `true` - Example:
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```html
|
||||
<button
|
||||
className="prettier-class"
|
||||
id="prettier-id"
|
||||
onClick={this.handleClick}>
|
||||
Click Here
|
||||
</button>
|
||||
```
|
||||
|
||||
- `false` - Example:
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```html
|
||||
<button
|
||||
className="prettier-class"
|
||||
id="prettier-id"
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
Click Here
|
||||
</button>
|
||||
```
|
||||
|
||||
| Default | CLI Override | API Override |
|
||||
| ------- | --------------------- | ------------------------- |
|
||||
| `false` | `--bracket-same-line` | `bracketSameLine: <bool>` |
|
||||
|
||||
## [Deprecated] JSX Brackets
|
||||
|
||||
_This option has been deprecated in v2.4.0, use --bracket-same-line instead_
|
||||
|
||||
Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements).
|
||||
|
||||
|
||||
Reference in new issue
Block a user