Skip to content

Commit b226631

Browse files
Add requiresTypeInformation
1 parent 39a6f7b commit b226631

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

packages/eslint-plugin-example-typed-linting/README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ export default tseslint.config(
3030

3131
<!-- begin auto-generated rules list -->
3232

33-
| Name | Description |
34-
| :----------------------------------------------------- | :------------------------ |
35-
| [no-loop-over-enums](docs/rules/no-loop-over-enums.md) | Avoid looping over enums. |
33+
💭 Requires [type information](https://typescript-eslint.io/linting/typed-linting).
34+
35+
| Name | Description | 💭 |
36+
| :----------------------------------------------------- | :------------------------ | :- |
37+
| [no-loop-over-enums](docs/rules/no-loop-over-enums.md) | Avoid looping over enums. | 💭 |
3638

3739
<!-- end auto-generated rules list -->
3840

packages/eslint-plugin-example-typed-linting/docs/rules/no-loop-over-enums.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Avoid looping over enums (`example-typed-linting/no-loop-over-enums`)
22

3+
💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4+
35
<!-- end auto-generated rule header -->
46

57
Example rule that demonstrates banning `for-in` looping over `enum`s.

packages/eslint-plugin-example-typed-linting/src/rules/no-loop-over-enum.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const rule = createRule({
2424
docs: {
2525
description: "Avoid looping over enums.",
2626
recommended: true,
27+
requiresTypeChecking: true,
2728
},
2829
messages: {
2930
loopOverEnum: "Do not loop over enums.",

packages/eslint-plugin-example-typed-linting/src/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ESLintUtils } from "@typescript-eslint/utils";
33
export interface ExampleTypedLintingRuleDocs {
44
description: string;
55
recommended?: boolean;
6+
requiresTypeChecking?: boolean;
67
}
78

89
export const createRule = ESLintUtils.RuleCreator<ExampleTypedLintingRuleDocs>(

0 commit comments

Comments
 (0)