# explicit-member-accessibility

Rule `typescript/explicit-member-accessibility`. Require explicit accessibility modifiers on class properties and methods

- Source: typescript
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 2.1M weekly downloads of presets that enable it
- Trend: +148.4% last quarter
- Rank: #1499 by reach, #78 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/explicit-member-accessibility` | no | safe | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/explicit-member-accessibility) |
| Oxlint | `typescript/explicit-member-accessibility` | no | safe | plugin `typescript`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/explicit-member-accessibility.html) |
| Biome | `style/useConsistentMemberAccessibility` | no | no | group style, since 1.9.0 | [docs](https://biomejs.dev/linter/rules/use-consistent-member-accessibility/) |

## Code examples

### Incorrect: the rule reports this

```ts
class Animal {
  constructor(name) {
    // No accessibility modifier
    this.animalName = name;
  }
  animalName: string; // No accessibility modifier
  get name(): string {
    // No accessibility modifier
    return this.animalName;
  }
  set name(value: string) {
    // No accessibility modifier
    this.animalName = value;
  }
  walk() {
    // method
  }
}
```

```ts
class Animal {
  public constructor(
    public breed,
    name,
  ) {
    // Parameter property and constructor
    this.animalName = name;
  }
  public animalName: string; // Property
  public get name(): string {
    // get accessor
    return this.animalName;
  }
  public set name(value: string) {
    // set accessor
    this.animalName = value;
  }
  public walk() {
    // method
  }
}
```

```ts
class Animal {
  public constructor(protected animalName) {}
  public get name() {
    return this.animalName;
  }
}
```

### Correct: the rule accepts this

```ts
class Animal {
  public constructor(
    public breed,
    name,
  ) {
    // Parameter property and constructor
    this.animalName = name;
  }
  private animalName: string; // Property
  get name(): string {
    // get accessor
    return this.animalName;
  }
  set name(value: string) {
    // set accessor
    this.animalName = value;
  }
  public walk() {
    // method
  }
}
```

```ts
class Animal {
  constructor(
    protected breed,
    name,
  ) {
    // Parameter property and constructor
    this.name = name;
  }
  private animalName: string; // Property
  get name(): string {
    // get accessor
    return this.animalName;
  }
  private set name(value: string) {
    // set accessor
    this.animalName = value;
  }
  protected walk() {
    // method
  }
}
```

```ts
class Animal {
  constructor(protected animalName) {}
  public get name() {
    return this.animalName;
  }
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/explicit-member-accessibility": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/explicit-member-accessibility": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useConsistentMemberAccessibility": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [typescript/parameter-properties](https://lintradar.dev/rules/typescript/parameter-properties.md): Require or disallow parameter properties in class constructors
- [typescript/prefer-enum-initializers](https://lintradar.dev/rules/typescript/prefer-enum-initializers.md): Require each enum member value to be explicitly initialized
- [typescript/no-unsafe-type-assertion](https://lintradar.dev/rules/typescript/no-unsafe-type-assertion.md): Disallow type assertions that narrow a type
- [typescript/prefer-regexp-exec](https://lintradar.dev/rules/typescript/prefer-regexp-exec.md): Enforce `RegExp#exec` over `String#match` if no global flag is provided
- [typescript/consistent-return](https://lintradar.dev/rules/typescript/consistent-return.md): Require `return` statements to either always or never specify values
- [typescript/default-param-last](https://lintradar.dev/rules/typescript/default-param-last.md): Enforce default parameters to be last

---

Web page: https://lintradar.dev/rules/typescript/explicit-member-accessibility. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
