Skip to content

Commit 2ef9f22

Browse files
authored
Prevent the useEslintrc option from being used (#565)
1 parent 41f0484 commit 2ef9f22

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/options-manager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ Transform an XO options into ESLint compatible options:
293293
const buildConfig = (options, prettierOptions) => {
294294
options = normalizeOptions(options);
295295

296+
if (options.useEslintrc) {
297+
throw new Error('The `useEslintrc` option is not supported');
298+
}
299+
296300
return flow(
297301
buildESLintConfig(options),
298302
buildXOConfig(options),

test/options-manager.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,17 @@ test('buildConfig: parserOptions', t => {
462462
t.is(config.baseConfig.parserOptions.sourceType, 'script');
463463
});
464464

465+
test('buildConfig: prevents useEslintrc option', t => {
466+
t.throws(() => {
467+
manager.buildConfig({
468+
useEslintrc: true
469+
});
470+
}, {
471+
instanceOf: Error,
472+
message: 'The `useEslintrc` option is not supported'
473+
});
474+
});
475+
465476
test('findApplicableOverrides', t => {
466477
const result = manager.findApplicableOverrides('/user/dir/foo.js', [
467478
{files: '**/f*.js'},

0 commit comments

Comments
 (0)