Repository: eslint/eslint
File: lib/types/index.d.ts (TypeScript)

Code before:
		 *   all the parts of the program that determine how the code looks rather than how it executes.
		 *   These rules work on parts of the code that aren't specified in the AST.
		 */
		type?: "problem" | "suggestion" | "layout" | undefined;
		/**
		 * Specifies whether the rule can return suggestions (defaults to `false` if omitted).
		 * Mandatory for rules that provide suggestions.
		 */
		hasSuggestions?: boolean | undefined;
	}

	interface RuleContext
		extends CoreRuleContext<{
			LangOptions: Linter.LanguageOptions;
			Code: SourceCode;
			RuleOptions: any[];
			Node: JSSyntaxElement;
			MessageIds: string;
		}> {}

	type ReportFixer = (fixer: RuleFixer) => Fix | Iterable<Fix> | null;

	interface ReportDescriptorOptionsBase {
		data?: Record<string, unknown> | undefined;

		fix?: ReportFixer | null | undefined;
	}

	interface SuggestionReportOptions {
		data?: Record<string, unknown> | undefined;

		fix: ReportFixer;
	}

	type SuggestionDescriptorMessage = { desc: string } | { messageId: string };
	type SuggestionReportDescriptor = SuggestionDescriptorMessage &
		SuggestionReportOptions;

	interface ReportDescriptorOptions extends ReportDescriptorOptionsBase {
		suggest?: SuggestionReportDescriptor[] | null | undefined;
	}

	type ReportDescriptor = ReportDescriptorMessage &
		ReportDescriptorLocation &
		ReportDescriptorOptions;
	type ReportDescriptorMessage = { message: string } | { messageId: string };
	type ReportDescriptorLocation =
		| { node: JSSyntaxElement }
		| { loc: AST.SourceLocation | ESTree.Position };

	interface RuleFixer {

Review comment (suggestion):
```suggestion
		fix?: ReportFixer
```
The same problem as above: this should only allow a function as [anything else](https://github.com/DMartens/eslint/blob/eac71fb77113de7bf199ff20c6ee44cefcb59848/lib/linter/file-report.js#L290) is ignored.

Code after:
		 *   all the parts of the program that determine how the code looks rather than how it executes.
		 *   These rules work on parts of the code that aren't specified in the AST.
		 */
		type?: "problem" | "suggestion" | "layout" | undefined;
		/**
		 * Specifies whether the rule can return suggestions (defaults to `false` if omitted).
		 * Mandatory for rules that provide suggestions.
		 */
		hasSuggestions?: boolean | undefined;
	}

	interface RuleContext
		extends CoreRuleContext<{
			LangOptions: Linter.LanguageOptions;
			Code: SourceCode;
			RuleOptions: any[];
			Node: JSSyntaxElement;
			MessageIds: string;
		}> {}

	type ReportFixer = (
		fixer: RuleFixer,
	) => null | Fix | IterableIterator<Fix> | Fix[];

	interface ReportDescriptorOptionsBase {
		data?: { [key: string]: string };

		fix?: null | ReportFixer;
	}

	interface SuggestionReportOptions {
		data?: { [key: string]: string };

		fix: ReportFixer;
	}

	type SuggestionDescriptorMessage = { desc: string } | { messageId: string };
	type SuggestionReportDescriptor = SuggestionDescriptorMessage &
		SuggestionReportOptions;

	interface ReportDescriptorOptions extends ReportDescriptorOptionsBase {
		suggest?: SuggestionReportDescriptor[] | null | undefined;
	}

	type ReportDescriptor = ReportDescriptorMessage &
		ReportDescriptorLocation &
		ReportDescriptorOptions;
	type ReportDescriptorMessage = { message: string } | { messageId: string };
	type ReportDescriptorLocation =
		| { node: ESTree.Node }
		| { loc: AST.SourceLocation | { line: number; column: number } };