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

Fix: Throw error if plugins from config is not an array. #8888

Merged
merged 1 commit into from Jul 9, 2017
Merged

Fix: Throw error if plugins from config is not an array. #8888

merged 1 commit into from Jul 9, 2017

Conversation

calvinf
Copy link
Contributor

@calvinf calvinf commented Jul 6, 2017

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X] Other, please explain:

I'm throwing an Error if the plugins set doesn't match expected input type. This isn't a bug necessarily, but it's something I've ran into multiple times on multiple projects where I initially tried to pass in a string (with one plugin name) instead of an array.

What changes did you make? (Give an overview)

I'm throwing an Error with a detailed error message if the user has a config with plugins as anything other than an array (which is expected).

Is there anything you'd like reviewers to focus on?

I have both a debug(/* ... */) statement and throwing an error. I'm not sure if that's the expected convention, but I tried to do similar to what's happening in other parts of the same plugins.js file. Build passes and tests pass.

@eslintbot
Copy link

Thanks for the pull request, @calvinf! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

LGTM

@calvinf
Copy link
Contributor Author

calvinf commented Jul 6, 2017

Updated commit message to match guidelines.

@calvinf calvinf changed the title Throw error if plugins from config is not an array. Fix: Throw error if plugins from config is not an array. Jul 6, 2017
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features labels Jul 9, 2017
Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@not-an-aardvark not-an-aardvark merged commit 597c217 into eslint:master Jul 9, 2017
@calvinf calvinf deleted the plugins-array-error branch July 9, 2017 20:22
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants