Open camchenry opened 2 weeks ago
I would like to work on this issue. Can I try this?
It seems that there are still some places in rulegen
that do not handle String.raw
and dedent
, outdent
in Expression::TaggedTemplateExpression
. I am thinking whether to deal with it in this issue, I would be grateful if you could give me some advice or guidance.
https://github.com/oxc-project/oxc/blob/4348eae1577bd72094d1ec1f6c2422c20288a3d9/tasks/rulegen/src/main.rs#L271
https://github.com/oxc-project/oxc/blob/4348eae1577bd72094d1ec1f6c2422c20288a3d9/tasks/rulegen/src/main.rs#L229
It seems that there are still some places in
rulegen
that do not handleString.raw
anddedent
,outdent
inExpression::TaggedTemplateExpression
. I am thinking whether to deal with it in this issue, I would be grateful if you could give me some advice or guidance.
I think we should try to handle outdent
/dedent
wherever it shows up, but I don't think we need to handle it all in one PR. It would probably help to break it up into a few smaller PRs to get feedback early and make it easier to review (and implement)
This does seem like a case we should handle, outdent
in output
seems to be a case that is often used: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/0d91fe8530611f68a95261e2a8f5f80b12caee35/test/prefer-ternary.mjs#L107-L111. We don't support String.raw
here yet, but that would be a good idea too, since there are examples of that: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/0d91fe8530611f68a95261e2a8f5f80b12caee35/test/string-content.mjs#L116
We already handle String.raw
here, but I think we should handle outdent
here as well, since it's also common to see outdent
inside of a code
property: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/0d91fe8530611f68a95261e2a8f5f80b12caee35/test/prefer-ternary.mjs#L98-L106
@camchenry Thank you very much for your reply. Considering the reusability of code, I have already handled String.raw
and dedent
, outdent
in Expression::TaggedTemplateExpression
. I plan to handle noFormat
(in typescript-eslint) in the future, and I will PR again at that time. If possible, could you please help me review #6866? Thanks in advance for your suggestions on my code.
Currently, we filter out any test cases which use the
outdent
anddedent
functions, which are sometimes used forunicorn
andtypescriot-eslint
rule tests. This means that we are likely missing many test cases from our rule testing. We should implement our own version ofdedent
andoutdent
so that we can import these test cases as well:https://github.com/oxc-project/oxc/blob/92812349e5266b074d2cb050cc7a6f200e4ac914/tasks/rulegen/src/main.rs#L319