> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-constructor-return

[Added in v0.1.14](https://github.com/web-infra-dev/rslint/releases/tag/v0.1.14)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-constructor-return': 'error',
    },
  },
]);
```

## Rule Details

Disallows `return` statements that return a value from class constructors. Returning a value from a constructor of a class is usually a mistake, as the returned value is only used when the constructor is called without `new`. Bare `return` statements (without a value) are allowed for flow control purposes.

Examples of **incorrect** code for this rule:

```javascript
class A {
  constructor() {
    return 'value';
  }
}

class B {
  constructor() {
    return { something: true };
  }
}
```

Examples of **correct** code for this rule:

```javascript
class A {
  constructor() {
    this.value = 42;
  }
}

class B {
  constructor() {
    if (!valid) {
      return; // bare return for flow control is fine
    }
    this.init();
  }
}
```

## Original Documentation

- [ESLint: no-constructor-return](https://eslint.org/docs/latest/rules/no-constructor-return)
- [Source code](https://github.com/eslint/eslint/blob/v10.8.1/lib/rules/no-constructor-return.js)
