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(eslint-plugin): [no-unused-vars] highlight last write reference #5267

Merged
merged 6 commits into from Jul 18, 2022

Conversation

armano2
Copy link
Member

@armano2 armano2 commented Jun 27, 2022

PR Checklist

Overview

Use only write references as report location


after brad pointed out that eslint did fix for that, i moved tests and additional logic from eslint/eslint#14335

original author snitin315

@armano2 armano2 added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin labels Jun 27, 2022
@typescript-eslint
Copy link
Contributor

typescript-eslint bot commented Jun 27, 2022

Thanks for the PR, @armano2!

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 on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@nx-cloud
Copy link

nx-cloud bot commented Jun 27, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit da543d8. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


Successfully ran 47 targets

Sent with 💌 from NxCloud.

@netlify
Copy link

netlify bot commented Jun 27, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit da543d8
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/62d2e473d72746000a76dc35
😎 Deploy Preview https://deploy-preview-5267--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@armano2 armano2 changed the title fix(eslint-plugin): [no-unused-vars] use only write references as report location fix(eslint-plugin): [no-unused-vars] highlight last write reference for no-unused-vars Jun 28, 2022
@armano2
Copy link
Member Author

armano2 commented Jun 28, 2022

@bradzacher it's unclear to me if we want to update this rule of all changes/fixes done in eslint in one commit or do we want to push them one by one, -> #4910 (comment)

@bradzacher
Copy link
Member

bradzacher commented Jul 2, 2022

@armano2 I'm happy if we do it all together or i'm fine if you think it's better to do them separately!
I don't think it matters either way!

@bradzacher
Copy link
Member

bradzacher commented Jul 4, 2022

test failures on node 18 otherwise this LGTM

@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label Jul 4, 2022
@armano2
Copy link
Member Author

armano2 commented Jul 8, 2022

ohh, that's surprising, i didn't see errors locally, i'm going to take a look

@armano2 armano2 dismissed a stale review via 15d1dde Jul 10, 2022
@codecov
Copy link

codecov bot commented Jul 10, 2022

Codecov Report

Merging #5267 (da543d8) into main (4138b0d) will increase coverage by 2.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5267      +/-   ##
==========================================
+ Coverage   91.67%   93.77%   +2.09%     
==========================================
  Files         363      287      -76     
  Lines       12227     9873    -2354     
  Branches     3549     2955     -594     
==========================================
- Hits        11209     9258    -1951     
+ Misses        668      335     -333     
+ Partials      350      280      -70     
Flag Coverage Δ
unittest 93.77% <100.00%> (+2.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/no-unused-vars.ts 95.95% <100.00%> (+0.04%) ⬆️
packages/type-utils/src/propertyTypes.ts
packages/utils/src/ts-eslint-scope/Definition.ts
packages/utils/src/ast-utils/eslint-utils/index.ts
packages/utils/src/ast-utils/misc.ts
packages/type-utils/src/predicates.ts
packages/type-utils/src/getContextualType.ts
packages/typescript-estree/src/convert-comments.ts
packages/utils/src/ts-eslint-scope/index.ts
packages/utils/src/ts-eslint/ParserOptions.ts
... and 67 more

@armano2 armano2 requested a review from bradzacher Jul 11, 2022
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Jul 11, 2022
@bradzacher bradzacher changed the title fix(eslint-plugin): [no-unused-vars] highlight last write reference for no-unused-vars fix(eslint-plugin): [no-unused-vars] highlight last write reference Jul 18, 2022
@bradzacher bradzacher merged commit c3f199a into main Jul 18, 2022
39 checks passed
@bradzacher bradzacher deleted the fix/no-unused-vars-report-identifiers branch Jul 18, 2022
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this issue Jul 18, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | patch | [`5.30.6` -> `5.30.7`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/5.30.6/5.30.7) |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | patch | [`5.30.6` -> `5.30.7`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/5.30.6/5.30.7) |

---

### Release Notes

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/eslint-plugin)</summary>

### [`v5.30.7`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5307-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5306v5307-2022-07-18)

[Compare Source](typescript-eslint/typescript-eslint@v5.30.6...v5.30.7)

##### Bug Fixes

-   **eslint-plugin:** \[no-inferrable] fix optional param to valid code ([#&#8203;5342](typescript-eslint/typescript-eslint#5342)) ([98f6d5e](typescript-eslint/typescript-eslint@98f6d5e))
-   **eslint-plugin:** \[no-unused-vars] highlight last write reference ([#&#8203;5267](typescript-eslint/typescript-eslint#5267)) ([c3f199a](typescript-eslint/typescript-eslint@c3f199a))

</details>

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/parser)</summary>

### [`v5.30.7`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5307-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5306v5307-2022-07-18)

[Compare Source](typescript-eslint/typescript-eslint@v5.30.6...v5.30.7)

##### Bug Fixes

-   expose types supporting old versions of typescript ([#&#8203;5339](typescript-eslint/typescript-eslint#5339)) ([4ba9bdb](typescript-eslint/typescript-eslint@4ba9bdb))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMTguMCIsInVwZGF0ZWRJblZlciI6IjMyLjExOC4wIn0=-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1467
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this issue Jul 31, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | minor | [`5.30.7` -> `5.31.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/5.30.7/5.31.0) |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | minor | [`5.30.7` -> `5.31.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/5.30.7/5.31.0) |

---

### Release Notes

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/eslint-plugin)</summary>

### [`v5.31.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5310-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5307v5310-2022-07-25)

[Compare Source](typescript-eslint/typescript-eslint@v5.30.7...v5.31.0)

##### Bug Fixes

-   **eslint-plugin:** \[typedef] Support nested array destructuring with type annotation ([#&#8203;5311](typescript-eslint/typescript-eslint#5311)) ([6d19efe](typescript-eslint/typescript-eslint@6d19efe))
-   **scope-manager:** handle typeParameters of TSInstantiationExpression ([#&#8203;5355](typescript-eslint/typescript-eslint#5355)) ([2595ccf](typescript-eslint/typescript-eslint@2595ccf))

##### Features

-   **eslint-plugin:** \[consistent-generic-ctors] check class field declaration ([#&#8203;5288](typescript-eslint/typescript-eslint#5288)) ([48f996e](typescript-eslint/typescript-eslint@48f996e))
-   **eslint-plugin:** \[prefer-nullish-coalescing] add ignoreTernaryTests option ([#&#8203;4965](typescript-eslint/typescript-eslint#4965)) ([f82727f](typescript-eslint/typescript-eslint@f82727f))

#### [5.30.7](typescript-eslint/typescript-eslint@v5.30.6...v5.30.7) (2022-07-18)

##### Bug Fixes

-   **eslint-plugin:** \[no-inferrable] fix optional param to valid code ([#&#8203;5342](typescript-eslint/typescript-eslint#5342)) ([98f6d5e](typescript-eslint/typescript-eslint@98f6d5e))
-   **eslint-plugin:** \[no-unused-vars] highlight last write reference ([#&#8203;5267](typescript-eslint/typescript-eslint#5267)) ([c3f199a](typescript-eslint/typescript-eslint@c3f199a))

#### [5.30.6](typescript-eslint/typescript-eslint@v5.30.5...v5.30.6) (2022-07-11)

**Note:** Version bump only for package [@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)

#### [5.30.5](typescript-eslint/typescript-eslint@v5.30.4...v5.30.5) (2022-07-04)

##### Bug Fixes

-   **eslint-plugin:** \[consistent-indexed-object-style] fix record mode fixer for generics with a default value ([#&#8203;5280](typescript-eslint/typescript-eslint#5280)) ([57f032c](typescript-eslint/typescript-eslint@57f032c))

#### [5.30.4](typescript-eslint/typescript-eslint@v5.30.3...v5.30.4) (2022-07-03)

**Note:** Version bump only for package [@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)

#### [5.30.3](typescript-eslint/typescript-eslint@v5.30.2...v5.30.3) (2022-07-01)

**Note:** Version bump only for package [@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)

#### [5.30.2](typescript-eslint/typescript-eslint@v5.30.1...v5.30.2) (2022-07-01)

**Note:** Version bump only for package [@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)

#### [5.30.1](typescript-eslint/typescript-eslint@v5.30.0...v5.30.1) (2022-07-01)

##### Bug Fixes

-   **eslint-plugin:** \[no-base-to-string] add missing apostrophe to message ([#&#8203;5270](typescript-eslint/typescript-eslint#5270)) ([d320174](typescript-eslint/typescript-eslint@58034e3))

</details>

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/parser)</summary>

### [`v5.31.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5310-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5307v5310-2022-07-25)

[Compare Source](typescript-eslint/typescript-eslint@v5.30.7...v5.31.0)

**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)

#### [5.30.7](typescript-eslint/typescript-eslint@v5.30.6...v5.30.7) (2022-07-18)

##### Bug Fixes

-   expose types supporting old versions of typescript ([#&#8203;5339](typescript-eslint/typescript-eslint#5339)) ([4ba9bdb](typescript-eslint/typescript-eslint@4ba9bdb))

#### [5.30.6](typescript-eslint/typescript-eslint@v5.30.5...v5.30.6) (2022-07-11)

**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)

#### [5.30.5](typescript-eslint/typescript-eslint@v5.30.4...v5.30.5) (2022-07-04)

**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)

#### [5.30.4](typescript-eslint/typescript-eslint@v5.30.3...v5.30.4) (2022-07-03)

**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)

#### [5.30.3](typescript-eslint/typescript-eslint@v5.30.2...v5.30.3) (2022-07-01)

**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)

#### [5.30.2](typescript-eslint/typescript-eslint@v5.30.1...v5.30.2) (2022-07-01)

**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)

#### 5.30.1 (2022-07-01)

**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMjcuMCIsInVwZGF0ZWRJblZlciI6IjMyLjEyNy4wIn0=-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1480
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants