Suggests using a concise arrow body when the block only returns an expression
| Property | Value |
|---|---|
| Category | Style |
| Default severity | off |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377084 |
| Language Service name | unnecessaryArrowBlock |
| Oxlint name | effecttsgo/unnecessary-arrow-block |
export const preview = (value: string) => {
/**
^ effecttsgo(unnecessary-arrow-block): This arrow function block only returns an expression and can use a concise body.
*/
return value.trim()
/**
^^^^^^^^^^^^^^^^^^^^
*/
}
/**
^
*/See the Language Service setup guide for installation instructions.
See the Oxlint setup guide for installation and patching instructions.
{
"$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
"options": {
"typeAware": true
},
"plugins": ["effecttsgo"],
"rules": {
"effecttsgo/unnecessary-arrow-block": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "unnecessaryArrowBlock": "warning" } } ] } }