Skip to content

Commit

Permalink
Prevent the useEslintrc option from being used (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb authored Jun 27, 2021
1 parent 41f0484 commit 2ef9f22
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ Transform an XO options into ESLint compatible options:
const buildConfig = (options, prettierOptions) => {
options = normalizeOptions(options);

if (options.useEslintrc) {
throw new Error('The `useEslintrc` option is not supported');
}

return flow(
buildESLintConfig(options),
buildXOConfig(options),
Expand Down
11 changes: 11 additions & 0 deletions test/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,17 @@ test('buildConfig: parserOptions', t => {
t.is(config.baseConfig.parserOptions.sourceType, 'script');
});

test('buildConfig: prevents useEslintrc option', t => {
t.throws(() => {
manager.buildConfig({
useEslintrc: true
});
}, {
instanceOf: Error,
message: 'The `useEslintrc` option is not supported'
});
});

test('findApplicableOverrides', t => {
const result = manager.findApplicableOverrides('/user/dir/foo.js', [
{files: '**/f*.js'},
Expand Down

0 comments on commit 2ef9f22

Please sign in to comment.