Skip to content

Commit

Permalink
docs(README): Add no-const-enum options.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Mar 30, 2019
1 parent 1637c8d commit c2ca2fe
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
21 changes: 20 additions & 1 deletion README.md
Expand Up @@ -44,7 +44,7 @@ The package includes the following rules (none of which are enabled by default):
| --- | --- | --- | --- |
| `ban-imports` | Disallows the use of banned imports. | No | [See below](#ban-imports) |
| `no-assign-mutated-array` | Disallows the assignment of returned, mutated arrays. Useful for those times you forget that `sort` and `reverse` mutate the array upon which they are called. | No | None |
| `no-const-enum` | Disallows the use of `const enum`. Constant enums are not compatible with isolated modules. | No | None |
| `no-const-enum` | Disallows the use of `const enum`. Constant enums are not compatible with isolated modules. | No | [See below](#no-const-enum) |
| `no-enum` | Disallows the use of `enum`. | No | None |
| `no-missing-dollar-expect` | Disallows [dtslint](https://github.com/Microsoft/dtslint) $ExpectType and $ExpectError expectations if the $ is missing. | No | None |
| `no-unsafe-callback-scope` | Disallows the use of variables/properties from unsafe/outer scopes in callbacks. | No | None |
Expand Down Expand Up @@ -74,6 +74,25 @@ For example, to following configuration would disallow `"foo"` with an explanati
}
```

<a name="no-const-enum"></a>

#### no-const-enum

This rule takes an optional object with an optional `allowLocal` property - which defaults to `false`. If `allowLocal` is `true`, only exported const enums are forbidden.

For example, to following configuration would local (i.e. non-exported) const enums:

```json
"rules": {
"no-const-enum": {
"options": [{
"allowLocal": true
}],
"severity": "error"
}
}
```

<a name="no-unused-declaration"></a>

#### no-unused-declaration
Expand Down
21 changes: 20 additions & 1 deletion docs/index.md
Expand Up @@ -8,7 +8,7 @@ The package includes the following rules (none of which are enabled by default):
| --- | --- | --- | --- |
| `ban-imports` | Disallows the use of banned imports. | No | [See below](#ban-imports) |
| `no-assign-mutated-array` | Disallows the assignment of returned, mutated arrays. Useful for those times you forget that `sort` and `reverse` mutate the array upon which they are called. | No | None |
| `no-const-enum` | Disallows the use of `const enum`. Constant enums are not compatible with isolated modules. | No | None |
| `no-const-enum` | Disallows the use of `const enum`. Constant enums are not compatible with isolated modules. | No | [See below](#no-const-enum) |
| `no-enum` | Disallows the use of `enum`. | No | None |
| `no-missing-dollar-expect` | Disallows [dtslint](https://github.com/Microsoft/dtslint) $ExpectType and $ExpectError expectations if the $ is missing. | No | None |
| `no-unsafe-callback-scope` | Disallows the use of variables/properties from unsafe/outer scopes in callbacks. | No | None |
Expand Down Expand Up @@ -38,6 +38,25 @@ For example, to following configuration would disallow `"foo"` with an explanati
}
```

<a name="no-const-enum"></a>

#### no-const-enum

This rule takes an optional object with an optional `allowLocal` property - which defaults to `false`. If `allowLocal` is `true`, only exported const enums are forbidden.

For example, to following configuration would local (i.e. non-exported) const enums:

```json
"rules": {
"no-const-enum": {
"options": [{
"allowLocal": true
}],
"severity": "error"
}
}
```

<a name="no-unused-declaration"></a>

#### no-unused-declaration
Expand Down

0 comments on commit c2ca2fe

Please sign in to comment.