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

Breaking change between 2.2.6 and 2.2.8 #196

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

Breaking change between 2.2.6 and 2.2.8 #196

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

Comments

@EvgenyOrekhov
Copy link
Contributor

Now eslint-plugin-decorator-position with default settings suddenly wants property decorators to be on the line above: https://github.com/EvgenyOrekhov/eslint-config-hardcore/blob/cf5c68bf2e2a0e9e5d853266461cde3d3d160b71/sort-class-members-test.js#L33

See EvgenyOrekhov/eslint-config-hardcore#172.

@NullVoxPopuli
Copy link
Owner

Well that wasn't supposed to happen. :(

Can you try to submit a reproduction? Either as an eslint test or reproduction smoke test?

@EvgenyOrekhov
Copy link
Contributor Author

I'm trying, but I can't reproduce it as an ESLint test or reproduction smoke test.

I'm trying to debug it, I can see that printWidth ends up being undefined, and then NaN:

{
  printWidth: undefined,
  overrides: { 'prefer-inline': [ 'decorator' ], above: [ 'decorator' ] }
}
{ inlineLength: 37, printWidth: NaN }

Perhaps it has something to do with that?

@NullVoxPopuli
Copy link
Owner

Oh! That could certainly be it! I refactored that stuff
How is your prettier config setup? (Eslint, separate config, etc)

@EvgenyOrekhov
Copy link
Contributor Author

I was able to reproduce the issue by removing this line from the smoke test:

@NullVoxPopuli
Copy link
Owner

Excellent find!

I can get a fix pr up today, if you don't want to

@EvgenyOrekhov
Copy link
Contributor Author

How is your prettier config setup?

In my ESLint config I use "extends": ["plugin:prettier/recommended"], and I do not have .prettierrc.js. But in some of my apps I use .prettierrc.js. The issue is reproducible in both cases when printWidth is not defined.

I can get a fix pr up today, if you don't want to

I'm struggling to figure out your development flow, can't really figure out how to use the smoke tests and whatnot. So, I would appreciate it if you fixed it :)

@NullVoxPopuli
Copy link
Owner

awesome! and thanks for the feedback. I'll try to make the CONTRIBUTING.md useful

NullVoxPopuli added a commit that referenced this issue Nov 9, 2020
NullVoxPopuli added a commit that referenced this issue Nov 9, 2020
issue introduced in #195.
was causing inline decorators to move to the line above because
`Number(undefined)` is 0, and having a printWidth of 0 breaks
all sorts of formatting.
NullVoxPopuli added a commit that referenced this issue Nov 9, 2020
issue introduced in #195.
was causing inline decorators to move to the line above because
`Number(undefined)` is 0, and having a printWidth of 0 breaks
all sorts of formatting.
github-actions bot pushed a commit that referenced this issue Nov 9, 2020
## [2.2.9](v2.2.8...v2.2.9) (2020-11-09)

### Bug Fixes

* **#196:** fix prettier unspecified printWidth ([2c327c8](2c327c8)), closes [#195](#195)
@NullVoxPopuli
Copy link
Owner

🎉 This issue has been resolved in version 2.2.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

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