Add loose autocomplete for common config values #19592
Unanswered
OmerDavidson
asked this question in
Q&A
Replies: 4 comments 6 replies
-
Where do you use |
Beta Was this translation helpful? Give feedback.
0 replies
-
when a user is using webpack and creating a webpack.config.js file. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Please don't use |
Beta Was this translation helpful? Give feedback.
1 reply
-
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request
What is the expected behavior?
when I am configuring my webpack, some values are of type string because they accept all strings. however, there are special cases where a value will have unique behavior.
A great example of this is output.publicPath. it is of type string but can also accept 'auto' for a specific use case.
I want to have autocomplete for auto while also letting the user pass any string.
What is motivation or use case for adding/changing the behavior?
Better DX. not requiring the developer to check the docs for common values. reduces typos.
How should this be implemented in your opinion?
In typescript, the following type:
type example= 'auto' | (string & {})
will allow all strings but will still autocomplete 'auto'.
here is a simple example I created.
If you would will like, I can add autocomplete for more config values
Are you willing to work on this yourself?
yes
Beta Was this translation helpful? Give feedback.
All reactions