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

Add API to resolve configuration object #3783

Closed
muuvmuuv opened this issue Nov 7, 2018 · 5 comments
Closed

Add API to resolve configuration object #3783

muuvmuuv opened this issue Nov 7, 2018 · 5 comments
Labels
good first issue is good for newcomers status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules

Comments

@muuvmuuv
Copy link

muuvmuuv commented Nov 7, 2018

Prettier has a function to resolve prettier config before actual formatting, I guess stylelint has something like that under the hood too. Would be nice to have this in the API aswell.

In prettier it looks like this:

    const resolveConfig: typeof ResolveConfig = prettier.resolveConfig;
    return resolveConfig(filePath, { useCache: false }).then((config: any) => confif);

https://prettier.io/docs/en/api.html#prettierresolveconfigfilepath-options

I think stylelints "resolveConfig" is here:

return stylelint
.getConfigForFile(configSearchPath)
.then(result => result.config);

@muuvmuuv muuvmuuv changed the title Option to resolve config before linting API to resolve config Nov 7, 2018
@hudochenkov
Copy link
Member

What is it use case?

@muuvmuuv
Copy link
Author

muuvmuuv commented Nov 7, 2018

I'm working on a new beautifier extension for Unibeautify.
Unibeautify has a function called resolveConfig, to retrieve beautifier-specific configuration.
It also provides the possibility to set options for specific languages for multiple beautifiers (prettier, stylelint...), which will be later transformed into readable breautifier config (e.g. stylelint). The function called beautify will then use this config or the config passed to Unibeautify to beautify a file.

@jeddy3 jeddy3 added the status: needs discussion triage needs further discussion label Nov 7, 2018
@jeddy3
Copy link
Member

jeddy3 commented Nov 9, 2018

@muuvmuuv Thanks for writing up your use case.

This is the second request, the other being #3734, to expose some of the internals of stylelint (as part of our API) to the benefit of tool authors. Unless anyone can think of a good reason why not to, I think we should welcome a PR do this (and undertake any necessary refactoring to make it possible) as our internals seem pretty solid and unlikely to change any time soon.

@jeddy3
Copy link
Member

jeddy3 commented Dec 27, 2018

Triaging issues...

As no one has raised any objections to this feature, I'm going to label as "help wanted".

@muuvmuuv Feel free to contribute this feature.

@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules good first issue is good for newcomers and removed status: needs discussion triage needs further discussion labels Dec 27, 2018
@jeddy3 jeddy3 changed the title API to resolve config Add API to resolve configuration object Dec 27, 2018
@is2ei
Copy link
Contributor

is2ei commented Jun 4, 2023

Is this issue still relevant?
It seems #5734 fixed it.

@muuvmuuv muuvmuuv closed this as completed Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue is good for newcomers status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules
Development

No branches or pull requests

4 participants