Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the useEslintrc option from being used #565

Merged
merged 3 commits into from Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/options-manager.js
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
9 changes: 9 additions & 0 deletions test/options-manager.js
Expand Up @@ -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({
Richienb marked this conversation as resolved.
Show resolved Hide resolved
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