Skip to content
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: support customize Rules types via generic #240

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

antfu
Copy link
Collaborator

@antfu antfu commented Oct 8, 2023

@Shinigami92
Copy link
Collaborator

I like the Strict extends boolean = false of this PR, but I would like not to have this dedicated to Rules as well es FlatConfig

Right now defineConfig is mostly meant to be used in .js files which do not have great/easy generic TS support
I would suggest to make it possible to call the method like so:

module.exports = defineConfig(config, { strict: true })
// or
module.exports = defineConfig(config, { strict: ['rules', 'settings'] })

Then the generic is inferred from that

We can also introduce a breaking change and make strict: true the default, so folks need to use strict: false if they want to add arbitrary config values

@Shinigami92
Copy link
Collaborator

the work for the augmented global properties support is done
you can now work on this again
I would like to have this in v2.0.0 release before moving out of beta
if you cant work on this in the next 30 days, please let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants