Comments (10)
Hmmmmm. I think that'd be fine. But I seem to remember someone having an issue with us using anything but stderr for logging off that nature. Maybe @osener and @denis-sokolov could share their thoughts.
from prettier-eslint-cli.
Indeed we donโt respect the log-level and we should.
I donโt believe we respected it before 81f6542 either. We switched from console.log
to console.error
, we did not touch the logger
that was added in #31.
@jackfranklin, for your needs you should do unix pipe redirection anyway: eslint-prettier-cli 2>/dev/null
will hide diagnostic messages. Why bother with log level?
from prettier-eslint-cli.
@denis-sokolov that's fair, I didn't think of doing that. However I do think I should be able to achieve the same by setting log level to silent - to me that's more intuitive. I am happy to take a stab at the PR if you'd like, else feel free to go ahead and close :)
Thanks for all your work on this tool btw ๐
from prettier-eslint-cli.
Thanks @denis-sokolov! Yeah, let's get a PR merged that not only preserves the stderr
behavior but also honors the log-level
. Probably wont be able to use logger
because it uses stdout
for everything except error
(also it prefixes all messages and this one we wouldn't want prefixed) which wouldn't make sense to me. I think most folks like to see it by default, so what do you think we log it unless the log level is set to silent?
from prettier-eslint-cli.
Agree - so shall I leave the calls using console.error
but wrap them in an if (logLevel is silent)
type thing?
from prettier-eslint-cli.
That sounds perfect ๐
from prettier-eslint-cli.
PS: I still find it kinda weird that the success case still uses console.error but I'm willing to go with that ;)
PR coming at ya tonight or tomorrow ๐
from prettier-eslint-cli.
@jackfranklin, if you find console.error
weird, consider that itโs just a shorthand. From inside the Node program we can directly write to any of the standard outputs with process.stdout.write
and process.stderr.write
.
from prettier-eslint-cli.
@denis-sokolov I meant more in that I find it odd that there's a success message, and you use console.error
to log it. I can understand why but it's a bit jarring on first glance! I'll get a PR in soon based on Kent's suggestions - thanks for your help clarifying :)
from prettier-eslint-cli.
It is a bit jarring, maybe as part of your PR you could add a short comment explaining why.
from prettier-eslint-cli.
Related Issues (20)
- support directory as argument HOT 3
- Is it possible to provide a `--check` option like prettier? HOT 2
- I have problem about this package, HOT 1
- eslint error: Configuration for rule "import/order" is invalid HOT 1
- What different beween use prettier-eslint-cli and use prettier and eslint step by step? HOT 3
- Can an error be reported when the error cannot be resolved? HOT 1
- `--list-different` doesn't exclude node_modules HOT 1
- `--list-different` from script fails HOT 1
- Error: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '' HOT 4
- Error after updating eslint to 8.1.0 HOT 8
- Still reports "jsxBracketSameLine is deprecated." even when option is not used HOT 1
- Option to fix only `layout` issues HOT 1
- Add --cache option HOT 1
- incompatibility with Next eslint config HOT 11
- [v7] bump dependencies HOT 1
- Maintainace: replace `semantic-release` with `changesets` HOT 12
- Support Yarn Plug n Play HOT 1
- Failed to load plugin 'react-hooks' declared in 'CLIOptions' HOT 1
- Support for Prettier 3 (TypeError: Expected `input` to be a `string`, got `object`) HOT 1
- Allow prettier-eslint-cli to write eslint errors/warnings to stderr? HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-eslint-cli.