Skip to content

Commit

Permalink
Fix a problem with using XO with Prettier
Browse files Browse the repository at this point in the history
Fixes #533
  • Loading branch information
sindresorhus committed Apr 20, 2021
1 parent fd8828d commit fa34c74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions lib/options-manager.js
Expand Up @@ -395,10 +395,6 @@ const buildPrettierConfig = (options, prettierConfig) => config => {
config.baseConfig.extends = config.baseConfig.extends.concat(prettierConfig);
}
}

if (options.ts) {
config.baseConfig.extends = config.baseConfig.extends.concat('prettier/@typescript-eslint');
}
}

return config;
Expand Down
5 changes: 2 additions & 3 deletions test/options-manager.js
Expand Up @@ -110,9 +110,8 @@ test('buildConfig: prettier: true, typescript file', t => {
}]);

// eslint-prettier-config must always be last
t.is(config.baseConfig.extends[config.baseConfig.extends.length - 1], 'prettier/@typescript-eslint');
t.is(config.baseConfig.extends[config.baseConfig.extends.length - 2], 'prettier');
t.is(config.baseConfig.extends[config.baseConfig.extends.length - 3], 'xo-typescript');
t.is(config.baseConfig.extends[config.baseConfig.extends.length - 1], 'prettier');
t.is(config.baseConfig.extends[config.baseConfig.extends.length - 2], 'xo-typescript');

// Indent rule is not enabled
t.is(config.rules.indent, undefined);
Expand Down

0 comments on commit fa34c74

Please sign in to comment.