-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { recommendedRuleSettings } from "./plugin.js"; | ||
import { plugin, recommendedRuleSettings } from "./plugin.js"; | ||
|
||
export { rules } from "./rules/index.js"; | ||
|
||
export const configs = { | ||
recommended: { | ||
plugins: ["expect-type"], | ||
plugins: { | ||
"expect-type": plugin, | ||
}, | ||
rules: recommendedRuleSettings, | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,28 +3,8 @@ | |
import { expect } from "./expect.js"; | ||
import { filename, ruleTester } from "./ruleTester.js"; | ||
|
||
ruleTester.run("expect", expect, { | ||
Check failure on line 6 in src/rules/twoslash.test.ts GitHub Actions / type_check
|
||
invalid: [ | ||
{ | ||
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 | ||
`, | ||
}, | ||
// Offers a fix for an empty assertion (the usual starting point) | ||
{ | ||
code: dedent` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lint error was being reported here by perfectionist:
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
export type SetRequiredNonNullable< | ||
BaseType, | ||
Keys extends keyof BaseType, | ||
> = Omit<BaseType, Keys> & { | ||
export type SetRequiredNonNullable<BaseType, Keys extends keyof BaseType> = { | ||
[K in Keys]: NonNullable<BaseType[K]>; | ||
}; | ||
} & Omit<BaseType, Keys>; |
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