oxc/crates
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
..
oxc Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_allocator Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_ast Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_ast_macros Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_cli refactor(linter): rename variable names prefix ESLint to Oxlint 2024-05-24 12:58:27 +08:00
oxc_codegen Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_diagnostics Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_index Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_js_regex refactor: rename CompactString to CompactStr (#2619) 2024-03-06 12:24:23 +08:00
oxc_language_server fix: fix some nightly warnings 2024-05-19 00:54:52 +08:00
oxc_linter feat(linter/eslint): Implement no-useless-concat (#3363) 2024-05-26 01:52:33 +08:00
oxc_macros chore: update toml format 2024-05-21 22:15:47 +08:00
oxc_minifier Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_module_lexer Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_parser fix(parser): fix lexer error while parsing parenthesized arrow expressions (#3400) 2024-05-24 09:59:17 +00:00
oxc_prettier fix(parser): correctly parse cls.fn<C> = x (#3208) 2024-05-09 10:23:45 +08:00
oxc_semantic feat(transformer): add TraverseCtx::generate_uid (#3394) 2024-05-24 17:19:02 +08:00
oxc_sourcemap chore(sourcemap): make JSONSourceMap fileds public (#3385) 2024-05-22 20:15:24 +08:00
oxc_span Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_syntax Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_transformer Release crates v0.13.1 2024-05-22 16:50:30 +08:00
oxc_traverse feat(transformer): add TraverseCtx::generate_uid (#3394) 2024-05-24 17:19:02 +08:00
oxc_wasm chore: update toml format 2024-05-21 22:15:47 +08:00