Skip to content

feat(rule): add valid-params rule#85

Merged
macklinu merged 2 commits into
eslint-community:masterfrom
macklinu:rule/valid-params
Mar 8, 2018
Merged

feat(rule): add valid-params rule#85
macklinu merged 2 commits into
eslint-community:masterfrom
macklinu:rule/valid-params

Conversation

@macklinu

@macklinu macklinu commented Feb 6, 2018

Copy link
Copy Markdown
Contributor

Resolves #47

As of now this rule simply checks how many arguments were supplied to the various Promise functions. If the length of arguments is invalid, it will report that as a lint violation. See the tests for examples.

There are a couple of other issues (#3, #60) that I could see being rolled into this valid-params rule. What are your thoughts on that? I think those could be separate PRs, but some feedback on those ideas being included in this rule / any rule would be great. 👍

@xjamundx

xjamundx commented Feb 6, 2018

Copy link
Copy Markdown
Contributor

@macklinu I can't remember if you're already a maintainer on this project or not, but I don't really have time to maintain this anymore. Do you want to to be added as an admin and given NPM access?

@macklinu macklinu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Some thoughts 🗣

Comment thread README.md Outdated
* `Promise.reject()` is called with 2+ arguments
* `Promise.then()` is called with 0 or 3+ arguments
* `Promise.catch()` is called with 0 or 2+ arguments
* `Promise.finally()` is called with 0 or 2+ arguments

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I got a little tired of writing the code examples by this point. 😂

Let me know if it would be better to include invalid code examples for each item in this list (similar to the Valid section above).

Comment thread index.js
'promise/avoid-new': 'warn',
'promise/no-return-in-finally': 'warn'
'promise/no-return-in-finally': 'warn',
'promise/valid-params': 'warn'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adding this to the recommended config as a warning. Thoughts on making this an error instead?

Comment thread rules/valid-params.js Outdated
meta: {
docs: {
description: '',
url: ''

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will update this and force push up.

@macklinu

macklinu commented Feb 6, 2018

Copy link
Copy Markdown
Contributor Author

@xjamundx I'm not a maintainer currently but would be glad to have that access and contribute in that way. Thank you! 😄

@macklinu

macklinu commented Feb 7, 2018

Copy link
Copy Markdown
Contributor Author

Just accepted the invite for push access. Thank you @xjamundx! 🎉

@xjamundx

xjamundx commented Feb 7, 2018

Copy link
Copy Markdown
Contributor

Sure @macklinu I'll grant you NPM access after a bit. Try to go through the existing issues. You can do whatever you want. And please add your name to the README as a contribute or maintainer. I only have about an hour a month to spend on stuff like this at the moment and have mostly moved on to using typed JS to solve my static analysis needs for JS

@macklinu macklinu force-pushed the rule/valid-params branch 8 times, most recently from 54c8e6e to febf5d1 Compare February 12, 2018 14:50
@xjamundx

Copy link
Copy Markdown
Contributor

I should probably give you NPM access now. What's your NPM username?

@macklinu

Copy link
Copy Markdown
Contributor Author

npm username is macklinu

@macklinu macklinu force-pushed the rule/valid-params branch 3 times, most recently from add92f8 to 8dbec40 Compare February 25, 2018 18:26
@macklinu macklinu mentioned this pull request Feb 25, 2018
8 tasks
@macklinu

Copy link
Copy Markdown
Contributor Author

I think this is ready to merge. Will leave this open until I'm ready to merge #108 and ship v3.7.0 early this week / in case anyone has feedback.

@macklinu macklinu merged commit 4782ae5 into eslint-community:master Mar 8, 2018
@macklinu macklinu deleted the rule/valid-params branch March 8, 2018 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants