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

fix(eslint-plugin): [consistent-indexed-object-style] fix record mode fixer for generics with a default value#5280

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

jbalsas
Copy link
Contributor

@jbalsasjbalsas commentedJul 1, 2022
edited by bradzacher
Loading

PR Checklist

Overview

Instead of justmapping each typeParameter node to its name, map it to the complete node text to avoid stripping information.

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.7.2&sourceType=module&code=JYOwLgpgTgZghgYwgAgGIHt0B4CCyC8ycIAngHzIDeAUMsgNoDWEJAXMgM5hSgDmAuuxwBuagF8gA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6MgeyeUuX0Ra1mAE0QAPRMNocARgCtEZOn0JJ0URNGgdokcGAC+IA0A&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

interfaceFoo<A=any>{[key:string]:A;}

Expected Result

typeFoo<A=any>=Record<string,A>;

Actual Result

typeFoo<A>=Record<string,A>;

@nx-cloud
Copy link

nx-cloudbot commentedJul 1, 2022
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commita93a1e4. 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 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@jbalsas!

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.

@netlify
Copy link

netlifybot commentedJul 1, 2022
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commita93a1e4
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/62be96dd57177500085190b8
😎 Deploy Previewhttps://deploy-preview-5280--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 yourNetlify site settings.

@codecov
Copy link

codecovbot commentedJul 1, 2022
edited
Loading

Codecov Report

Merging#5280 (a93a1e4) intomain (394425b) willincrease coverage by2.42%.
The diff coverage is100.00%.

@@            Coverage Diff             @@##             main    #5280      +/-   ##==========================================+ Coverage   91.34%   93.76%   +2.42%==========================================  Files         132      287     +155       Lines        1491     9871    +8380       Branches      226     2954    +2728     ==========================================+ Hits         1362     9256    +7894- Misses         65      335     +270- Partials       64      280     +216
FlagCoverage Δ
unittest93.76% <100.00%> (+2.42%)⬆️

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

Impacted FilesCoverage Δ
...lugin/src/rules/consistent-indexed-object-style.ts92.06% <100.00%> (ø)
...es/eslint-plugin/src/rules/no-duplicate-imports.ts97.67% <0.00%> (ø)
...nt-plugin/src/rules/switch-exhaustiveness-check.ts97.95% <0.00%> (ø)
...ackages/eslint-plugin/src/util/getWrappingFixer.ts100.00% <0.00%> (ø)
...ages/eslint-plugin/src/rules/ban-tslint-comment.ts100.00% <0.00%> (ø)
packages/eslint-plugin/src/rules/comma-dangle.ts93.33% <0.00%> (ø)
...ckages/eslint-plugin/src/util/getESLintCoreRule.ts75.00% <0.00%> (ø)
...ages/eslint-plugin/src/rules/prefer-regexp-exec.ts100.00% <0.00%> (ø)
packages/eslint-plugin/src/rules/no-redeclare.ts91.89% <0.00%> (ø)
.../eslint-plugin/src/util/explicitReturnTypeUtils.ts96.38% <0.00%> (ø)
... and146 more

@bradzacherbradzacher added the bugSomething isn't working labelJul 2, 2022
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.

thanks for fixing this!

200

@bradzacherbradzacher changed the titlefix(eslint-plugin): fixes consistent-indexed-object-style record mode fixer for generics with a default valuefix(eslint-plugin): [consistent-indexed-object-style] fix record mode fixer for generics with a default valueJul 4, 2022
@bradzacherbradzacher merged commit57f032c intotypescript-eslint:mainJul 4, 2022
@jbalsas
Copy link
ContributorAuthor

celebrate_ferrell

crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull requestJul 11, 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.0` -> `5.30.5`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/5.30.0/5.30.5) || [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | patch | [`5.30.0` -> `5.30.5`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/5.30.0/5.30.5) |---### Release Notes<details><summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/eslint-plugin)</summary>### [`v5.30.5`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5305-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5304v5305-2022-07-04)[Compare Source](typescript-eslint/typescript-eslint@v5.30.4...v5.30.5)##### 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))### [`v5.30.4`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5304-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5303v5304-2022-07-03)[Compare Source](typescript-eslint/typescript-eslint@v5.30.3...v5.30.4)**Note:** Version bump only for package [@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)### [`v5.30.3`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5303-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5302v5303-2022-07-01)[Compare Source](typescript-eslint/typescript-eslint@v5.30.2...v5.30.3)**Note:** Version bump only for package [@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)### [`v5.30.2`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5302-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5301v5302-2022-07-01)[Compare Source](typescript-eslint/typescript-eslint@v5.30.1...v5.30.2)**Note:** Version bump only for package [@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)### [`v5.30.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5301-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5300v5301-2022-07-01)[Compare Source](typescript-eslint/typescript-eslint@v5.30.0...v5.30.1)##### 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.30.5`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5305-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5304v5305-2022-07-04)[Compare Source](typescript-eslint/typescript-eslint@v5.30.4...v5.30.5)**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)### [`v5.30.4`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5304-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5303v5304-2022-07-03)[Compare Source](typescript-eslint/typescript-eslint@v5.30.3...v5.30.4)**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)### [`v5.30.3`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5303-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5302v5303-2022-07-01)[Compare Source](typescript-eslint/typescript-eslint@v5.30.2...v5.30.3)**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)### [`v5.30.2`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5302-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5301v5302-2022-07-01)[Compare Source](typescript-eslint/typescript-eslint@v5.30.1...v5.30.2)**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)### [`v5.30.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5301-2022-07-01)[Compare Source](typescript-eslint/typescript-eslint@v5.30.0...v5.30.1)**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).Co-authored-by: cabr2-bot <cabr2.help@gmail.com>Reviewed-on:https://codeberg.org/Calciumdibromid/CaBr2/pulls/1443Reviewed-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>
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull requestJul 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/1480Reviewed-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-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsAug 4, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@bradzacherbradzacherbradzacher approved these changes

Assignees
No one assigned
Labels
bugSomething isn't working
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: [@typescript-eslint/consistent-indexed-object-style] Record mode fixer strips default value for generic
2 participants
@jbalsas@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp