Skip to content

Commit

Permalink
docs: document option
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed Nov 19, 2019
1 parent 411c8fe commit 92f5865
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions packages/eslint-plugin/docs/rules/no-extraneous-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,25 @@ const StaticOnly = {

This rule accepts a single object option.

- `allowConstructorOnly: true` will silence warnings about classes containing only a constructor.
- `allowEmpty: true` will silence warnings about empty classes.
- `allowStaticOnly: true` will silence warnings about classes containing only static members.
```ts
type Options = {
// allow extraneous classes if they only contain a constructor
allowConstructorOnly?: boolean;
// allow extraneous classes if they have no body (i.e. are empty)
allowEmpty?: boolean;
// allow extraneous classes if they only contain static members
allowStaticOnly?: boolean;
// allow extraneous classes if they are have a decorator
allowWithDecorator?: boolean;
};

const defaultOptions: Options = {
allowConstructorOnly: false,
allowEmpty: false,
allowStaticOnly: false,
allowWithDecorator: false,
};
```

## When Not To Use It

Expand Down

0 comments on commit 92f5865

Please sign in to comment.