Skip to content

Commit a56689e

Browse files
XhmikosRdevinrhode2
authored andcommitted
Replace Prettier's jsxBracketSameLine option with bracketSameLine (xojs#609)
1 parent dbdf640 commit a56689e

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

lib/options-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ const mergeWithPrettierConfig = (options, prettierOptions) => {
487487
{
488488
singleQuote: true,
489489
bracketSpacing: false,
490-
jsxBracketSameLine: false,
490+
bracketSameLine: false,
491491
trailingComma: 'all',
492492
tabWidth: normalizeSpaces(options),
493493
useTabs: !options.space,

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ The [Prettier options](https://prettier.io/docs/en/options.html) will be read fr
228228
- [trailingComma](https://prettier.io/docs/en/options.html#trailing-commas): `all`
229229
- [singleQuote](https://prettier.io/docs/en/options.html#quotes): `true`
230230
- [bracketSpacing](https://prettier.io/docs/en/options.html#bracket-spacing): `false`
231-
- [jsxBracketSameLine](https://prettier.io/docs/en/options.html#jsx-brackets): `false`
231+
- [bracketSameLine](https://prettier.io/docs/en/options.html#bracket-line): `false`
232232

233233
If contradicting options are set for both Prettier and XO an error will be thrown.
234234

test/fixtures/prettier/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"semi": false,
55
"tabWidth": 4,
66
"bracketSpacing": false,
7-
"jsxBracketSameLine": false,
7+
"bracketSameLine": false,
88
"singleQuote": false,
99
"trailingComma": "all"
1010
}

test/options-manager.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ test('buildConfig: prettier: true', t => {
8989

9090
t.deepEqual(config.baseConfig.plugins, ['prettier']);
9191
// Sets the `semi`, `useTabs` and `tabWidth` options in `prettier/prettier` based on the XO `space` and `semicolon` options
92-
// Sets `singleQuote`, `trailingComma`, `bracketSpacing` and `jsxBracketSameLine` with XO defaults
92+
// Sets `singleQuote`, `trailingComma`, `bracketSpacing` and `bracketSameLine` with XO defaults
9393
t.deepEqual(config.baseConfig.rules['prettier/prettier'], ['error', {
9494
useTabs: true,
9595
bracketSpacing: false,
96-
jsxBracketSameLine: false,
96+
bracketSameLine: false,
9797
semi: true,
9898
singleQuote: true,
9999
tabWidth: 2,
@@ -114,11 +114,11 @@ test('buildConfig: prettier: true, typescript file', t => {
114114

115115
t.deepEqual(config.baseConfig.plugins, ['prettier']);
116116
// Sets the `semi`, `useTabs` and `tabWidth` options in `prettier/prettier` based on the XO `space` and `semicolon` options
117-
// Sets `singleQuote`, `trailingComma`, `bracketSpacing` and `jsxBracketSameLine` with XO defaults
117+
// Sets `singleQuote`, `trailingComma`, `bracketSpacing` and `bracketSameLine` with XO defaults
118118
t.deepEqual(config.baseConfig.rules['prettier/prettier'], ['error', {
119119
useTabs: true,
120120
bracketSpacing: false,
121-
jsxBracketSameLine: false,
121+
bracketSameLine: false,
122122
semi: true,
123123
singleQuote: true,
124124
tabWidth: 2,
@@ -144,7 +144,7 @@ test('buildConfig: prettier: true, semicolon: false', t => {
144144
t.deepEqual(config.baseConfig.rules['prettier/prettier'], ['error', {
145145
useTabs: true,
146146
bracketSpacing: false,
147-
jsxBracketSameLine: false,
147+
bracketSameLine: false,
148148
semi: false,
149149
singleQuote: true,
150150
tabWidth: 2,
@@ -165,7 +165,7 @@ test('buildConfig: prettier: true, space: 4', t => {
165165
t.deepEqual(config.baseConfig.rules['prettier/prettier'], ['error', {
166166
useTabs: false,
167167
bracketSpacing: false,
168-
jsxBracketSameLine: false,
168+
bracketSameLine: false,
169169
semi: true,
170170
singleQuote: true,
171171
tabWidth: 4,
@@ -186,7 +186,7 @@ test('buildConfig: prettier: true, space: true', t => {
186186
t.deepEqual(config.baseConfig.rules['prettier/prettier'], ['error', {
187187
useTabs: false,
188188
bracketSpacing: false,
189-
jsxBracketSameLine: false,
189+
bracketSameLine: false,
190190
semi: true,
191191
singleQuote: true,
192192
tabWidth: 2,
@@ -271,12 +271,12 @@ test('buildConfig: nodeVersion: >=8', t => {
271271
t.deepEqual(config.baseConfig.rules['node/no-unsupported-features/node-builtins'], ['error', {version: '>=8'}]);
272272
});
273273

274-
test('mergeWithPrettierConfig: use `singleQuote`, `trailingComma`, `bracketSpacing` and `jsxBracketSameLine` from `prettier` config if defined', t => {
274+
test('mergeWithPrettierConfig: use `singleQuote`, `trailingComma`, `bracketSpacing` and `bracketSameLine` from `prettier` config if defined', t => {
275275
const prettierOptions = {
276276
singleQuote: false,
277277
trailingComma: 'none',
278278
bracketSpacing: false,
279-
jsxBracketSameLine: false,
279+
bracketSameLine: false,
280280
};
281281
const result = manager.mergeWithPrettierConfig({}, prettierOptions);
282282
const expected = {
@@ -298,7 +298,7 @@ test('mergeWithPrettierConfig: determine `tabWidth`, `useTabs`, `semi` from xo c
298298
const result = manager.mergeWithPrettierConfig({space: 4, semicolon: false}, {});
299299
const expected = {
300300
bracketSpacing: false,
301-
jsxBracketSameLine: false,
301+
bracketSameLine: false,
302302
singleQuote: true,
303303
trailingComma: 'all',
304304
...prettierOptions,
@@ -315,7 +315,7 @@ test('mergeWithPrettierConfig: determine `tabWidth`, `useTabs`, `semi` from pret
315315
const result = manager.mergeWithPrettierConfig({}, prettierOptions);
316316
const expected = {
317317
bracketSpacing: false,
318-
jsxBracketSameLine: false,
318+
bracketSameLine: false,
319319
singleQuote: true,
320320
trailingComma: 'all',
321321
...prettierOptions,

0 commit comments

Comments
 (0)