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

Too many "printWidth not set" warnings #198

Closed
EvgenyOrekhov opened this issue Nov 9, 2020 · 7 comments
Closed

Too many "printWidth not set" warnings #198

EvgenyOrekhov opened this issue Nov 9, 2020 · 7 comments
Labels

Comments

@EvgenyOrekhov
Copy link
Contributor

eslint-plugin-decorator-position is spamming my terminal, it gives me the "printWidth not set" warning for every file:

image

That's not useful.

@NullVoxPopuli
Copy link
Owner

Does it go away if you set printWidth in prettier's config?

NullVoxPopuli added a commit that referenced this issue Nov 9, 2020
fix(#198): fix issue #198 by only displaying warn once
github-actions bot pushed a commit that referenced this issue Nov 9, 2020
## [2.2.10](v2.2.9...v2.2.10) (2020-11-09)

### Bug Fixes

* **#198:** fix issue [#198](#198) by only displaying warn once ([98a18a1](98a18a1))
@NullVoxPopuli
Copy link
Owner

🎉 This issue has been resolved in version 2.2.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

@EvgenyOrekhov
Copy link
Contributor Author

Does it go away if you set printWidth in prettier's config?

I'm not using a Prettier config in that project, I'm using the defaults.

@EvgenyOrekhov
Copy link
Contributor Author

We actually have the "always use defaults" policy for Prettier for all our projects. We don't use custom Prettier configs (with some rare exceptions when we need to use some experimental feature, like Glimmer parser).

And I don't see why this warning has to exist at all. The lack of a Prettier config or the lack of the printWidth option is usually not a mistake, it is intentional.

@NullVoxPopuli
Copy link
Owner

That's a good point. Hmm

I guess if we could get the prettier default value from prettier itself, instead of hard coding, this custom stuff can all go away

@NullVoxPopuli
Copy link
Owner

ah-ha: https://github.com/prettier/prettier/blob/3d7016e2dc38e3b03df8129c52dd85b1ff9aec60/src/main/core-options.js#L192-L199

If this data is used, then we don't need to warn or use a hard-coded value. the upstream default can be used, which is much safer

@NullVoxPopuli
Copy link
Owner

added here: #202

if there are any issues, pls let me know.
I'm sure this project is still missing a few key test cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants