halkeye / eslint-formatter-multiple

MIT License
16 stars 4 forks source link

Conditional Formatters support #84

Open ThisIsMissEm opened 2 years ago

ThisIsMissEm commented 2 years ago

This plugin looks great, though something that I could desire is the ability to toggle between two different configuration sets, based on an environment variable — maybe this can be done by piggybacking on the eslintrc configuration file / the settings option: https://eslint.org/docs/latest/user-guide/configuring/configuration-files#adding-shared-settings

Then we could say, for example:

process.env.CI ? {
        "name": "checkstyle",
        "output": "file",
        "path": "eslint-checkstyle.xml"
      } : {
        "name": "stylish",
        "output": "console"
      };
halkeye commented 2 years ago

I'll be honest. I don't have any projects that use this anymore. Its unlikely I'll spend time adding freatures.

Job I was at, when we used it, we just provided --formatter multiple for CI, and had the default the pretty print one.

ThisIsMissEm commented 2 years ago

Okay, I'll have to see if I can get the suggestion I made working, if we decide we need this, and then we can either contribute it upstream or maintain our own fork.