-
Notifications
You must be signed in to change notification settings - Fork 5
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: make recommended
config a valid flat config
#462
fix: make recommended
config a valid flat config
#462
Conversation
{ | ||
code: dedent` | ||
const square = (x: number) => x * x; | ||
const four = square(2); | ||
// ^? const four: string | ||
`, | ||
errors: [ | ||
{ | ||
column: 7, | ||
line: 2, | ||
messageId: "TypesDoNotMatch", | ||
}, | ||
], | ||
filename, | ||
output: dedent` | ||
const square = (x: number) => x * x; | ||
const four = square(2); | ||
// ^? const four: number | ||
`, | ||
}, |
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 removed test is a duplicate of another one below:
eslint-plugin-expect-type/src/rules/twoslash.test.ts
Lines 102 to 121 in bf98512
// Fixer for comment that doesn't continue the twoslash comment | |
{ | |
code: dedent` | |
const square = (x: number) => x * x; | |
const four = square(2); | |
// ^? const four: string | |
`, | |
errors: [ | |
{ | |
column: 7, | |
line: 2, | |
messageId: "TypesDoNotMatch", | |
}, | |
], | |
filename, | |
output: dedent` | |
const square = (x: number) => x * x; | |
const four = square(2); | |
// ^? const four: number | |
`, |
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.
A lint error was being reported here by perfectionist:
.../eslint-plugin-expect-type/src/utils/types.ts
4:28 error Expected "{ [K in Keys]: NonNullable<BaseType[K]>;
}" to come before "Omit<BaseType, Keys>" perfectionist/sort-intersection-types
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.
Wonderful, thanks @fasttime! 🙌
CI failures are unrelated and already on |
@all-contributors please add @fasttime for code.
|
I've put up a pull request to add @fasttime! 🎉 I couldn't determine any contributions to add, did you specify any contributions? |
Adds @fasttime as a contributor for code. This was requested by JoshuaKGoldberg [in this comment](#462 (comment)) --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
## PR Checklist - [x] Addresses an existing open issue: fixes #486 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Reverts the part of #462 that changed `src/index.ts`. That file is still the legacy config format; it's `eslint-plugin-expect-type/configs/recommended`. Repro: https://github.com/JoshuaKGoldberg/repros/tree/eslint-plugin-expect-type-eslint-configs 💖
PR Checklist
status: accepting prs
Overview
This PR updates the
recommended
config to make it a valid flat config. Currently, therecommended
config'splugins
field is an array, and thus this config cannot be used in flat mode, whereplugins
is expected to be an object.It looks like the readme file already contains instructions for embedding the
recommended
config in a flat config file, but therecommended
config itself hasn't been updated yet.I noticed this problem while working on eslint/eslint#18869.