Skip to content

Commit 26a574c

Browse files
authored
chore(prettier): Take Prettier 2.4.0's jsxBracketSameLine → bracketSameLine (#749)
BREAKING CHANGE: Support Prettier 2.4.0+
1 parent b271486 commit 26a574c

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

.all-contributorsrc

+10
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,16 @@
310310
"contributions": [
311311
"code"
312312
]
313+
},
314+
{
315+
"login": "chrisbobbe",
316+
"name": "Chris Bobbe",
317+
"avatar_url": "https://avatars.githubusercontent.com/u/22248748?v=4",
318+
"profile": "https://github.com/chrisbobbe",
319+
"contributions": [
320+
"bug",
321+
"code"
322+
]
313323
}
314324
],
315325
"repoType": "github",

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fall back to the `prettier` defaults:
183183
// prettier-eslint doesn't currently support
184184
// inferring these two (Pull Requests welcome):
185185
parser: 'babylon',
186-
jsxBracketSameLine: false,
186+
bracketSameLine: false,
187187
}
188188
```
189189

@@ -305,12 +305,12 @@ Thanks goes to these people ([emoji key][emojis]):
305305
<tr>
306306
<td align="center"><a href="https://github.com/cy6erskunk"><img src="https://avatars3.githubusercontent.com/u/754849?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Igor</b></sub></a><br /><a href="#maintenance-cy6erskunk" title="Maintenance">🚧</a></td>
307307
<td align="center"><a href="https://campcode.dev/"><img src="https://avatars.githubusercontent.com/u/10620169?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rebecca Vest</b></sub></a><br /><a href="https://github.com/prettier/prettier-eslint/commits?author=idahogurl" title="Code">💻</a></td>
308+
<td align="center"><a href="https://github.com/chrisbobbe"><img src="https://avatars.githubusercontent.com/u/22248748?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chris Bobbe</b></sub></a><br /><a href="https://github.com/prettier/prettier-eslint/issues?q=author%3Achrisbobbe" title="Bug reports">🐛</a> <a href="https://github.com/prettier/prettier-eslint/commits?author=chrisbobbe" title="Code">💻</a></td>
308309
</tr>
309310
</table>
310311

311312
<!-- markdownlint-restore -->
312313
<!-- prettier-ignore-end -->
313-
314314
<!-- ALL-CONTRIBUTORS-LIST:END -->
315315

316316
This project follows the [all-contributors][all-contributors] specification.

src/__tests__/utils.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ const getPrettierOptionsFromESLintRulesTests = [
113113
},
114114
{
115115
rules: {},
116-
options: { jsxBracketSameLine: true },
117-
fallbackPrettierOptions: { jsxBracketSameLine: true }
116+
options: { bracketSameLine: true },
117+
fallbackPrettierOptions: { bracketSameLine: true }
118118
},
119119
{
120120
rules: { 'react/jsx-closing-bracket-location': [2, 'after-props'] },
121-
options: { jsxBracketSameLine: true }
121+
options: { bracketSameLine: true }
122122
},
123123
{
124124
rules: { 'react/jsx-closing-bracket-location': [2, 'tag-aligned'] },
125-
options: { jsxBracketSameLine: false }
125+
options: { bracketSameLine: false }
126126
},
127127
{
128128
rules: {
@@ -133,7 +133,7 @@ const getPrettierOptionsFromESLintRulesTests = [
133133
}
134134
]
135135
},
136-
options: { jsxBracketSameLine: true }
136+
options: { bracketSameLine: true }
137137
},
138138
{
139139
rules: {

src/utils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ const OPTION_GETTERS = {
4646
ruleValue: rules => getRuleValue(rules, 'indent'),
4747
ruleValueToPrettierOption: getUseTabs
4848
},
49-
jsxBracketSameLine: {
49+
bracketSameLine: {
5050
ruleValue: rules =>
5151
getRuleValue(rules, 'react/jsx-closing-bracket-location', 'nonEmpty'),
52-
ruleValueToPrettierOption: getJsxBracketSameLine
52+
ruleValueToPrettierOption: getBracketSameLine
5353
},
5454
arrowParens: {
5555
ruleValue: rules => getRuleValue(rules, 'arrow-parens'),
@@ -263,7 +263,7 @@ function getUseTabs(eslintValue, fallbacks) {
263263
return makePrettierOption('useTabs', prettierValue, fallbacks);
264264
}
265265

266-
function getJsxBracketSameLine(eslintValue, fallbacks) {
266+
function getBracketSameLine(eslintValue, fallbacks) {
267267
let prettierValue;
268268

269269
if (eslintValue === 'after-props') {
@@ -278,7 +278,7 @@ function getJsxBracketSameLine(eslintValue, fallbacks) {
278278
prettierValue = eslintValue;
279279
}
280280

281-
return makePrettierOption('jsxBracketSameLine', prettierValue, fallbacks);
281+
return makePrettierOption('bracketSameLine', prettierValue, fallbacks);
282282
}
283283

284284
function getArrowParens(eslintValue, fallbacks) {

0 commit comments

Comments
 (0)