-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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): [ban-types] update message to suggest object
instead of Record<string, unknown>
#6079
Conversation
Thanks for the PR, @kmin-jeong! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Are we un-suggesting |
@Josh-Cena @JoshuaKGoldberg I changed the part of the message according to the proposal in the issue and sent a pr draft. I saw the issue and understood that the object was used instead of 'Record<string, unknown>'. Did I get it wrong? I haven't worked on the code and the test code yet. |
This is the correct fix (it's just a re-creation of #5018). |
@bradzacher @Josh-Cena @JoshuaKGoldberg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you've introduced some type errors
@bradzacher I add type Types and type checkrequiredTypes to fix lint errors. |
After looking at this issue and the discussion mentioned in the issue, I added the test code and requested the pr. I don't know the range where I shouldn't use type Record <string, never>. if I just need to modify the message to 'use object instead', or if I need to modify the code in the type Record <string, never> and let the message 'use object instead' come out. @JoshuaKGoldberg and @bradzacher, Are there any other issues or discursions that mention the scope of use of Record?
|
@kmin-jeong the fix we're looking for here is to update the message so that it suggests using |
@bradzacher I vaguely thought I should fix the code, too. I modified ban-types.ts again like Commit (f679c99). |
Psst - you don't have to keep @ tagging us. We'll see the updates come in and reply when we can. 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes look good, thanks! I'll take care of the test revert.
I also filled out the Overview
in the PR.
Shouldn't the PR title say "instead of |
Ah thanks, good catch on the title - updated. And yeah they're not quite the same but |
object
instead of Record<string, unknown>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | minor | [`5.44.0` -> `5.46.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/5.44.0/5.46.0) | | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | minor | [`5.44.0` -> `5.46.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/5.44.0/5.46.0) | --- ### Release Notes <details> <summary>typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin)</summary> ### [`v5.46.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#​5460-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5451v5460-2022-12-08) [Compare Source](typescript-eslint/typescript-eslint@v5.45.1...v5.46.0) ##### Bug Fixes - **eslint-plugin:** \[ban-types] update message to suggest `object` instead of `Record<string, unknown>` ([#​6079](typescript-eslint/typescript-eslint#6079)) ([d91a5fc](typescript-eslint/typescript-eslint@d91a5fc)) ##### Features - **eslint-plugin:** \[prefer-nullish-coalescing] logic and test for strict null checks ([#​6174](typescript-eslint/typescript-eslint#6174)) ([8a91cbd](typescript-eslint/typescript-eslint@8a91cbd)) #### [5.45.1](typescript-eslint/typescript-eslint@v5.45.0...v5.45.1) (2022-12-05) ##### Bug Fixes - **eslint-plugin:** \[keyword-spacing] unexpected space before/after in `import type` ([#​6095](typescript-eslint/typescript-eslint#6095)) ([98caa92](typescript-eslint/typescript-eslint@98caa92)) - **eslint-plugin:** \[no-shadow] add call and method signatures to `ignoreFunctionTypeParameterNameValueShadow` ([#​6129](typescript-eslint/typescript-eslint#6129)) ([9d58b6b](typescript-eslint/typescript-eslint@9d58b6b)) - **eslint-plugin:** \[prefer-optional-chain] collect MetaProperty type ([#​6083](typescript-eslint/typescript-eslint#6083)) ([d7114d3](typescript-eslint/typescript-eslint@d7114d3)) - **eslint-plugin:** \[sort-type-constituents, sort-type-union-intersection-members] handle some required parentheses cases in the fixer ([#​6118](typescript-eslint/typescript-eslint#6118)) ([5d49d5d](typescript-eslint/typescript-eslint@5d49d5d)) ### [`v5.45.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#​5451-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5450v5451-2022-12-05) [Compare Source](typescript-eslint/typescript-eslint@v5.45.0...v5.45.1) ##### Bug Fixes - **eslint-plugin:** \[keyword-spacing] unexpected space before/after in `import type` ([#​6095](typescript-eslint/typescript-eslint#6095)) ([98caa92](typescript-eslint/typescript-eslint@98caa92)) - **eslint-plugin:** \[no-shadow] add call and method signatures to `ignoreFunctionTypeParameterNameValueShadow` ([#​6129](typescript-eslint/typescript-eslint#6129)) ([9d58b6b](typescript-eslint/typescript-eslint@9d58b6b)) - **eslint-plugin:** \[prefer-optional-chain] collect MetaProperty type ([#​6083](typescript-eslint/typescript-eslint#6083)) ([d7114d3](typescript-eslint/typescript-eslint@d7114d3)) - **eslint-plugin:** \[sort-type-constituents, sort-type-union-intersection-members] handle some required parentheses cases in the fixer ([#​6118](typescript-eslint/typescript-eslint#6118)) ([5d49d5d](typescript-eslint/typescript-eslint@5d49d5d)) ### [`v5.45.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#​5450-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5440v5450-2022-11-28) [Compare Source](typescript-eslint/typescript-eslint@v5.44.0...v5.45.0) ##### Bug Fixes - **eslint-plugin:** \[array-type] --fix flag removes parentheses from type ([#​5997](typescript-eslint/typescript-eslint#5997)) ([42b33af](typescript-eslint/typescript-eslint@42b33af)) - **eslint-plugin:** \[keyword-spacing] prevent crash on no options ([#​6073](typescript-eslint/typescript-eslint#6073)) ([1f19998](typescript-eslint/typescript-eslint@1f19998)) - **eslint-plugin:** \[member-ordering] support private fields ([#​5859](typescript-eslint/typescript-eslint#5859)) ([f02761a](typescript-eslint/typescript-eslint@f02761a)) - **eslint-plugin:** \[prefer-readonly] report if a member's property is reassigned ([#​6043](typescript-eslint/typescript-eslint#6043)) ([6e079eb](typescript-eslint/typescript-eslint@6e079eb)) ##### Features - **eslint-plugin:** \[member-ordering] add a required option for required vs. optional member ordering ([#​5965](typescript-eslint/typescript-eslint#5965)) ([2abadc6](typescript-eslint/typescript-eslint@2abadc6)) </details> <details> <summary>typescript-eslint/typescript-eslint (@​typescript-eslint/parser)</summary> ### [`v5.46.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#​5460-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5451v5460-2022-12-08) [Compare Source](typescript-eslint/typescript-eslint@v5.45.1...v5.46.0) **Note:** Version bump only for package [@​typescript-eslint/parser](https://github.com/typescript-eslint/parser) #### [5.45.1](typescript-eslint/typescript-eslint@v5.45.0...v5.45.1) (2022-12-05) ##### Bug Fixes - **parser:** remove the jsx option requirement for automatic jsx pragma resolution ([#​6134](typescript-eslint/typescript-eslint#6134)) ([e777f5e](typescript-eslint/typescript-eslint@e777f5e)) ### [`v5.45.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#​5451-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5450v5451-2022-12-05) [Compare Source](typescript-eslint/typescript-eslint@v5.45.0...v5.45.1) ##### Bug Fixes - **parser:** remove the jsx option requirement for automatic jsx pragma resolution ([#​6134](typescript-eslint/typescript-eslint#6134)) ([e777f5e](typescript-eslint/typescript-eslint@e777f5e)) ### [`v5.45.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#​5450-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5440v5450-2022-11-28) [Compare Source](typescript-eslint/typescript-eslint@v5.44.0...v5.45.0) **Note:** Version bump only for package [@​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, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC40Mi4wIiwidXBkYXRlZEluVmVyIjoiMzQuNTEuMCJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1666 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>
PR Checklist
Overview
Updates the report message to mention
object
first instead ofRecord<string, never>
.Co-authored-by: @RyanCavanaugh