Rule Detail:
[link](https://eslint.org/docs/latest/rules/no-useless-concat)
---
I haven't implemented one condition with the multiline string test case
and honestly I don't really understand why it is allowed? And also not
sure how I would implement that in oxlint.
Another issue is that maybe the output isn't great, the underlining
matches the whole BinaryExpression, for example:
```
+ ╭─[no_useless_concat.tsx:1:1]
+ 1 │ foo + `a` + `b`
+ · ───────────────
```
So maybe instead the diagnostic should get two spans passed, for each
Expression::StringLiteral or Expression::TemplateLiteral, that would
also allow the help text to show that it can be written as `"ab"`.
But an automatic fixxer would be more helpful I reckon :)
---------
Co-authored-by: Boshen <boshenc@gmail.com>
Add `TraverseCtx::generate_uid` method.
This is modelled on Babel's `scope.generateUid()` method. As discussed
in
https://github.com/oxc-project/oxc/discussions/3251#discussioncomment-9416826,
this is required to fix most of the remaining failing tests in
transformer Milestone 1.
I have implemented this to work as closely as possible to Babel, so that
it will generate same output as Babel for our tests. However, as
mentioned in the code comments, this means it's a pretty expensive
function to call. Those code comments suggest 2 ways in which we could
make it much more efficient, but we'd need to decide how we're going to
handle divergence from Babel before we can decide which route to go.
I've left it as a `TODO(improve-on-babel)` for now.
Adds the following tasks so we can use them in the website repo to generate documentations.
`cargo run -p website`
* linter-cli
* linter-rules
* linter-json-schema
It is a simple change, Before this, we had a lot of fields in our
control flow graph that were only used during the build process. This PR
aims to simplify the ControlFlowGraph.
PS: Sorry for the long branch name, Apprerantly graphite gets confused
when you write the commit body using the `gt create` command.
Follow-on after #3296.
Make parsing binary/octal/hex numeric literals a little more efficient.
These changes all rely on that we know more than the compiler does -
that strings passed to these `parse_*` functions can only contain a
certain set of characters.
The ast span is not ordering at rolldown, eg the module original ast is
`a,b,c`, after mutate could be `b,c,a`. So here revert changes from
[here](https://github.com/oxc-project/oxc/pull/2728).