Closed tolu closed 7 years ago
What would the purpose of this be?
I don't use jest so don't know exactly how it works but it seems like you setup a configuration in package.json
. ESLint is different in that you don't have any preconfigured setup, you just specify the formatter when running ESLint (at least that's the only way I'm aware of).
So, the way I currently do it is to have 2 different npm scripts in package.json - one for regular output, one for TeamCity output:
"lint": "node node_modules/.bin/eslint app/assets/javascripts"
and
"lint:teamcity": "node node_modules/.bin/eslint app/assets/javascripts -f './node_modules/eslint-teamcity/index.js'"
How are you running ESLint?
I'm open to this, but I'm not quite convinced yet.
I use ESLint just as you do, with two npm scripts. The purpose of my idea was mainly to be able to drop the one script and have the reporter know enough of its surrounding environment to kick in when needed.
But having read your comment I think I see your point.
Jest and ESLint have fundamentally different setup that enables this idea in an easy way for lint, that can have multiple reporters, but might be more of an anti-pattern when it comes to ESLint.
Much of the same thinking, the tool knowing in which context it is run, is part of the Volkswagen, and on a more serious note Fake.
So in the end I'm not sure if this was actually a good idea, it might be more natural if ESLint had your TeamCity reporter builtin and used it as default when running in the TeamCity context.
Thanks for a great reporter and the quick feedback!
Not a problem at all! Thanks for opening the issue 👍
Would it be possible to have this formatter only run if actually running on TeamCity?
I've seen that the jest teamcity reporter does something like this:
What do you think?