Handles associating single-line and multi-line comments with props, for standard and spread attributes.
The code in alphabetizeJsxPropsWithSpread is really messy and I don't even quite understand it myself, but it is working - I'm going to add a refactor task. Since there's good test coverage there already, I think it should be pretty low-risk.
Additionally, the implementation here basically dwarfs the 'forgotten node' fix in https://github.com/brandongregoryscott/collation/commit/3e1df555c582a18ce8b39aad30ce7f821fa7e0e8. The ordering in alphabetize-jsx-props is important and I think we're going to keep hitting forgotten node errors in the future. I'm thinking that the p-retry library and retrying a rule (i.e. rerunning it on the same file until the errors are sorted out) should prevent a bunch of hacky re-try or one-off handling for forgotten nodes.
Finally, I slightly tweaked the logic in the fuzzy file finder so that it doesn't suggest an empty array. That doesn't help 🤦
Resolves #25
Handles associating single-line and multi-line comments with props, for standard and spread attributes.
The code in
alphabetizeJsxPropsWithSpread
is really messy and I don't even quite understand it myself, but it is working - I'm going to add a refactor task. Since there's good test coverage there already, I think it should be pretty low-risk.Additionally, the implementation here basically dwarfs the 'forgotten node' fix in https://github.com/brandongregoryscott/collation/commit/3e1df555c582a18ce8b39aad30ce7f821fa7e0e8. The ordering in
alphabetize-jsx-props
is important and I think we're going to keep hitting forgotten node errors in the future. I'm thinking that thep-retry
library and retrying a rule (i.e. rerunning it on the same file until the errors are sorted out) should prevent a bunch of hacky re-try or one-off handling for forgotten nodes.Finally, I slightly tweaked the logic in the fuzzy file finder so that it doesn't suggest an empty array. That doesn't help 🤦