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): add rule no-unsafe-return#1644

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

Merged
bradzacher merged 1 commit intomasterfromno-unsafe-return
Mar 3, 2020

Conversation

bradzacher
Copy link
Member

@bradzacherbradzacher commentedFeb 26, 2020
edited
Loading

See#791

I think it's better to introduce these as a number of separate rules.
It makes it easier for people to opt in to the rules, and keeps each implementation small and focused.
This also makes it easier and faster to build and release, as we can build and release smaller rules instead of releasing one monolithic rule.

Based off of#1643


This rule does two things:

  1. it checks all function returns and errors if you returnany.
  2. if the type is not explicitly any, it compares a return type with the function signature's return type, comparing the generic parameters to ensure no unsafe assignment is occurring:
    • i.e. this will error in the lint rule, but is "safe" in TS
      function foo(): Set<string> { return new Set<any>([1]) }

@bradzacherbradzacher added enhancement: new plugin ruleNew rule request for eslint-plugin blocked by another PRPRs which are ready to go but waiting on another PR labelsFeb 26, 2020
@typescript-eslint
Copy link
Contributor

Thanks for the PR,@bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day.

@bradzacherbradzacher linked an issueFeb 26, 2020 that may beclosed by this pull request
@bradzacherbradzacher changed the base branch frommaster tono-unsafe-member-accessFebruary 28, 2020 07:22
@bradzacherbradzacherforce-pushed theno-unsafe-member-access branch from05df893 to745b7b3CompareMarch 3, 2020 07:10
@bradzacherbradzacherforce-pushed theno-unsafe-return branch 2 times, most recently from47ba6e8 to296b0e7CompareMarch 3, 2020 07:24
@bradzacherbradzacherforce-pushed theno-unsafe-member-access branch from745b7b3 to7e385adCompareMarch 3, 2020 07:56
@bradzacherbradzacher changed the base branch fromno-unsafe-member-access tomasterMarch 3, 2020 08:15
@codecov
Copy link

codecovbot commentedMar 3, 2020
edited
Loading

Codecov Report

Merging#1644 intomaster willdecrease coverage by0.01%.
The diff coverage isn/a.

@@            Coverage Diff             @@##           master    #1644      +/-   ##==========================================- Coverage   95.37%   95.36%   -0.02%==========================================  Files         146      147       +1       Lines        6836     6904      +68       Branches     1964     1984      +20     ==========================================+ Hits         6520     6584      +64- Misses        111      112       +1- Partials      205      208       +3
Impacted FilesCoverage Δ
...ckages/eslint-plugin/src/rules/no-unsafe-return.ts95.00% <0.00%> (ø)

@bradzacherbradzacher merged commitcfc3ef1 intomasterMar 3, 2020
@bradzacherbradzacher removed the blocked by another PRPRs which are ready to go but waiting on another PR labelMar 3, 2020
@bradzacherbradzacher deleted the no-unsafe-return branchMarch 3, 2020 09:11
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 20, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
No reviews
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.

New set of rules:no-unsafe-*
1 participant
@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp