Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(eslint-plugin): added new rule await-promise#192

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

JoshuaKGoldberg
Copy link
Member

Adds the equivalent of TSLint'sawait-promise rule.

Adds the equivalent of TSLint's `await-promise` rule.
@codecov
Copy link

codecovbot commentedFeb 3, 2019
edited
Loading

Codecov Report

Merging#192 intomaster willincrease coverage by0.01%.
The diff coverage is100%.

@@            Coverage Diff             @@##           master     #192      +/-   ##==========================================+ Coverage   96.95%   96.96%   +0.01%==========================================  Files          71       72       +1       Lines        2694     2705      +11       Branches      435      436       +1     ==========================================+ Hits         2612     2623      +11  Misses         49       49                Partials       33       33
Impacted FilesCoverage Δ
packages/eslint-plugin/src/rules/await-thenable.ts100% <100%> (ø)

@JoshuaKGoldbergJoshuaKGoldberg changed the titlefeat(eslint-plugin) added new rule await-promisefeat: (eslint-plugin) added new rule await-promiseFeb 3, 2019
j-f1
j-f1 previously requested changesFeb 3, 2019
@armano2armano2 changed the titlefeat: (eslint-plugin) added new rule await-promisefeat(eslint-plugin): added new rule await-promiseFeb 3, 2019
@JoshuaKGoldberg
Copy link
MemberAuthor

Btw, this ended up using the samecontainsType(ByName) util as#194, so I moved it toutils/types.js.

@armano2armano2 added the enhancement: new plugin ruleNew rule request for eslint-plugin labelFeb 3, 2019
bradzacher
bradzacher previously approved these changesFeb 3, 2019
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

code LGTM

bradzacher
bradzacher previously approved these changesFeb 7, 2019
@JamesHenry
Copy link
Member

Apologies for the conflicts, we decided to remove the counts from the ROADMAP here:#225

They are too awkward to maintain manually, so this is the last time you will have to deal with syncing that up!

bradzacher
bradzacher previously approved these changesFeb 7, 2019
@JoshuaKGoldberg
Copy link
MemberAuthor

Awesome, glad the type checker works out that way! That looks like it'll need to be a shared method by this,#194, and other promise-checking functions.

Would you still want theallowedPromiseNames option as part of the rule? I can't think of a way for it to be particularly useful unless folks have improperly written Promise-like typings, so I'll add test cases for definitions mirroring Bluebird's and other popular polyfills.

@mysticatea
Copy link
Member

Would you still want theallowedPromiseNames option as part of the rule?

I don't think so.

And, I think we should rename the rule torequire-await-thenable.

  • In practice, Rules which disallow arbitary notation if something is lacking haverequire- prefix.
  • Now the rule checksthen property rather thanPromise.
JamesHenry reacted with thumbs up emoji

@JoshuaKGoldberg
Copy link
MemberAuthor

JoshuaKGoldberg commentedFeb 24, 2019
edited
Loading

Turns outtsutils already has aisThenableType method, so I used that one and removedallowedPromiseNames. ✔

require-await-thenable

👍 onpromise ->thenable, but I'm still hesitant to sustain therequire- prefix tradition for similar reasons to theno- prefix tradition:

  • it's rather inconvenient to work with largereslintrc files when the names' alphabetical ordering isn't very useful
  • it's hard to tell when rules will eventually allow the opposite of therequire- behavior; for example, if this rule eventually also handles whether we should or shouldn'tawait values of typeany and/orunknown
  • require- has a naming relevancy torequire() and modules, which is confusing for newcomers to look at

I don't want to bikeshed in your repository(especially if the focus is to adhere to existing ESLint traditions) 😄 so if you'd like I can rename torequire-await-thenable in this PR! Just a couple of cents.

j-f1 reacted with thumbs up emoji

@merlinnot
Copy link

Hey guys, is it still blocked? It looks like the TS migration is done.

@JamesHenry
Copy link
Member

@mysticatea@j-f1 please can you update your reviews of this PR?

Probably worth just getting it in at this point!

Copy link
Member

@mysticateamysticatea left a comment

Choose a reason for hiding this comment

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

I'm sorry for my disappeared. I have lost track in busy of working for ESLint 6.

I left some fixes and suggestions.

mysticateaand others added6 commitsApril 3, 2019 08:08
Co-Authored-By: JoshuaKGoldberg <joshuakgoldberg@outlook.com>
Co-Authored-By: JoshuaKGoldberg <joshuakgoldberg@outlook.com>
Co-Authored-By: JoshuaKGoldberg <joshuakgoldberg@outlook.com>
Co-Authored-By: JoshuaKGoldberg <joshuakgoldberg@outlook.com>
@JamesHenry
Copy link
Member

Perfectly understandable@mysticatea! Thanks for looping back to it.

Looks like@JoshuaKGoldberg addressed your most recent feedback, would you agree?

@JamesHenryJamesHenry added awaiting responseIssues waiting for a reply from the OP or another party and removed awaiting responseIssues waiting for a reply from the OP or another party labelsApr 4, 2019
@bradzacherbradzacher merged commit5311342 intotypescript-eslint:masterApr 11, 2019
@JoshuaKGoldbergJoshuaKGoldberg deleted the typescript-eslint-await-promise branchApril 11, 2019 11:22
kaicataldo pushed a commit to kaicataldo/typescript-eslint that referenced this pull requestAug 27, 2019
…int#192)The vscode autoformatter is completely at odds with prettier, so if you don't have the prettier extension installed, you end up with wild changes.Additionally if you've got both the beautify and prettier extensions installed, it can cause some serious issues.Forcing it to be on will probably cause a lot of headaches to anyone trying to contribute unless they get their environment setup perfectly (sorry@weirdpattern for earlier!!)
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 21, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@SwatinemSwatinemSwatinem left review comments

@ficristoficristoficristo left review comments

@mysticateamysticateamysticatea approved these changes

@bradzacherbradzacherbradzacher approved these changes

@j-f1j-f1Awaiting requested review from j-f1

Assignees
No one assigned
Labels
enhancement: new plugin ruleNew rule request for eslint-plugin
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

9 participants
@JoshuaKGoldberg@JamesHenry@bradzacher@mysticatea@j-f1@merlinnot@Swatinem@ficristo@armano2

[8]ページ先頭

©2009-2025 Movatter.jp