Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ const mergeWithPrettierConf = (opts, prettierOpts) => {
{},
{
singleQuote: true,
trailingComma: opts.esnext === false ? 'none' : 'es5',
bracketSpacing: false,
jsxBracketSameLine: false
jsxBracketSameLine: false,
trailingComma: 'none',
tabWidth: normalizeSpaces(opts),
useTabs: !opts.space,
semi: opts.semicolon !== false
},
{tabWidth: normalizeSpaces(opts), useTabs: !opts.space, semi: opts.semicolon !== false},
prettierOpts,
mergeFn
);
Expand Down
12 changes: 6 additions & 6 deletions test/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test('buildConfig: prettier: true', t => {
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5'
trailingComma: 'none'
}]});
// eslint-prettier-config must always be last
t.deepEqual(config.baseConfig.extends.slice(-1), ['prettier']);
Expand All @@ -111,7 +111,7 @@ test('buildConfig: prettier: true, semicolon: false', t => {
semi: false,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5'
trailingComma: 'none'
}]);
// Indent rule is not enabled
t.is(config.rules.indent, undefined);
Expand All @@ -132,7 +132,7 @@ test('buildConfig: prettier: true, space: 4', t => {
semi: true,
singleQuote: true,
tabWidth: 4,
trailingComma: 'es5'
trailingComma: 'none'
}]);
// Indent rule is not enabled
t.is(config.rules.indent, undefined);
Expand Down Expand Up @@ -174,7 +174,7 @@ test('buildConfig: prettier: true, space: true', t => {
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5'
trailingComma: 'none'
}]);
// Indent rule is not enabled
t.is(config.rules.indent, undefined);
Expand Down Expand Up @@ -287,7 +287,7 @@ test('mergeWithPrettierConf: determine `tabWidth`, `useTabs`, `semi` from xo con
const prettierOpts = {tabWidth: 4, useTabs: false, semi: false};
const result = manager.mergeWithPrettierConf({space: 4, semicolon: false}, {});
const expected = Object.assign(
{bracketSpacing: false, jsxBracketSameLine: false, singleQuote: true, trailingComma: 'es5'},
{bracketSpacing: false, jsxBracketSameLine: false, singleQuote: true, trailingComma: 'none'},
prettierOpts
);
t.deepEqual(result, expected);
Expand All @@ -297,7 +297,7 @@ test('mergeWithPrettierConf: determine `tabWidth`, `useTabs`, `semi` from pretti
const prettierOpts = {useTabs: false, semi: false, tabWidth: 4};
const result = manager.mergeWithPrettierConf({}, prettierOpts);
const expected = Object.assign(
{bracketSpacing: false, jsxBracketSameLine: false, singleQuote: true, trailingComma: 'es5'},
{bracketSpacing: false, jsxBracketSameLine: false, singleQuote: true, trailingComma: 'none'},
prettierOpts
);
t.deepEqual(result, expected);
Expand Down