From da075560f64c9f5d53f33ba700a12ec12214a512 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Sun, 27 Jun 2021 23:00:06 +1200 Subject: [PATCH 1/3] Prevent the `useEslintrc` option from being used Signed-off-by: Richie Bendall --- lib/options-manager.js | 4 ++++ test/options-manager.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/options-manager.js b/lib/options-manager.js index 0c81dc46..ffa8a67b 100644 --- a/lib/options-manager.js +++ b/lib/options-manager.js @@ -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), diff --git a/test/options-manager.js b/test/options-manager.js index b9054e89..4bf6b67f 100644 --- a/test/options-manager.js +++ b/test/options-manager.js @@ -457,6 +457,15 @@ 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'}, From d9a869fdf6d00153488df48b80e20fc2e1aba4c7 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Mon, 28 Jun 2021 00:40:10 +1200 Subject: [PATCH 2/3] Update options-manager.js --- test/options-manager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/options-manager.js b/test/options-manager.js index 4bf6b67f..7fc16353 100644 --- a/test/options-manager.js +++ b/test/options-manager.js @@ -458,9 +458,11 @@ test('buildConfig: parserOptions', t => { }); test('buildConfig: prevents useEslintrc option', t => { - t.throws(() => manager.buildConfig({ - useEslintrc: true - }), { + t.throws(() => { + manager.buildConfig({ + useEslintrc: true + }) + }, { instanceOf: Error, message: 'The `useEslintrc` option is not supported' }); From 4b2cfac34c24cfd58b07c560f1e7e0ab09742747 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Mon, 28 Jun 2021 00:41:53 +1200 Subject: [PATCH 3/3] Update options-manager.js --- test/options-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/options-manager.js b/test/options-manager.js index 7fc16353..ba560aab 100644 --- a/test/options-manager.js +++ b/test/options-manager.js @@ -461,7 +461,7 @@ test('buildConfig: prevents useEslintrc option', t => { t.throws(() => { manager.buildConfig({ useEslintrc: true - }) + }); }, { instanceOf: Error, message: 'The `useEslintrc` option is not supported'