oxc/crates/oxc_linter
Jelle van der Waa 147864cfeb
feat(linter/eslint): Implement no-useless-concat (#3363)
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>
2024-05-26 01:52:33 +08:00
..
examples refactor(diagnostics): s/OxcDiagnostic::new/OxcDiagnostic::error 2024-05-12 01:08:54 +08:00
fixtures fix(linter/default): ignore unsupported files (e.g. .vue) 2024-05-12 13:33:29 +08:00
src feat(linter/eslint): Implement no-useless-concat (#3363) 2024-05-26 01:52:33 +08:00
tests feat(tasks/website): code generate the linter rules 2024-05-23 15:21:37 +08:00
Cargo.toml chore(linter): write json schema to npm/oxlint 2024-05-24 13:28:03 +08:00