-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: improve type suggestions with specific defineFlatConfig #150
Conversation
@Shinigami92 It's really hard to combine all kinds of configs into one function.
If I add It can really easily lead to a mix of the normal config and flat config. I have no idea, what do you think? @Shinigami92 |
Try to combine all into one function: export function defineConfig<
Config extends ESLintConfig | FlatESLintConfig | FlatESLintConfigs // maybe with "= ESLintConfig" for default
>(config: Config): Config; |
@Shinigami92 I tried, but it's still like I said (#150 (comment)). All keys of config are optional, so TypeScript is unable to figure out which kind of config. |
Yeah, but it has two benefits
An eslint config doesn't change that often. The benefit is more like having autosuggestion for rules and see deprecated rules |
|
Yeah... okay, now I understand better what you initially mean So I think we have no better option as defining a special |
I think maybe we could remove |
Yes, we could do that, but doesn't it allow all kind of presets? Like |
@Shinigami92 No, flat config requires import plugins explicitly. |
tsc
.defineConfig
.