Phillip9587 / nx-stylelint

Nx plugin to use Stylelint in your Nx workspace.
MIT License
84 stars 15 forks source link

Support for different file formats of .stylelintrc #480

Open christophbuehler opened 1 year ago

christophbuehler commented 1 year ago

Seems like JSON is hardcoded as the file format of stylelintrc (both the relative file and the root file). Unsure if it is possible to create custom syntax with JSON. https://github.com/Phillip9587/nx-stylelint/blob/main/packages/nx-stylelint/src/generators/configuration/generator.ts#L86

Phillip9587 commented 1 year ago

You can use the file format you want to use. Just create your custom config file e.g. .stylelintrc.yaml. The executor will pick it up automatically. Its the same behavior as stylelint has itself. You can also mix json and yaml files for example. You just have to take care of the extends properties.

The generators only supports creating stylelintrc.json files. But you can open a PR to select the file format if you want it as a feature.

christophbuehler commented 1 year ago

Hi @Phillip9587, thanks for addressing this. I was able to make it work with .stylelintrc.json. If there is some interest by the community to support more file formats (or even .stylelint in package.json), I could draft a PR for this. Cheers, Chris