diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 3ed92b4a5..4a836006a 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -479,11 +479,11 @@ export interface RuleTextEdit { * @param fixer The text editor to apply the fix. * @returns The fix(es) for the violation. */ -type RuleFixer = ( +export type RuleFixer = ( fixer: RuleTextEditor, ) => RuleTextEdit | Iterable | null; -interface ViolationReportBase { +export interface ViolationReportBase { /** * The data to insert into the message. */ @@ -501,10 +501,10 @@ interface ViolationReportBase { suggest?: SuggestedEdit[] | null | undefined; } -type ViolationMessage = +export type ViolationMessage = | { message: string } | { messageId: MessageIds }; -type ViolationLocation = +export type ViolationLocation = | { loc: SourceLocation | Position } | { node: Node }; @@ -517,7 +517,7 @@ export type ViolationReport< // #region Suggestions -interface SuggestedEditBase { +export interface SuggestedEditBase { /** * The data to insert into the message. */ @@ -529,7 +529,7 @@ interface SuggestedEditBase { fix: RuleFixer; } -type SuggestionMessage = { desc: string } | { messageId: string }; +export type SuggestionMessage = { desc: string } | { messageId: string }; /** * A suggested edit for a rule violation. @@ -539,7 +539,7 @@ export type SuggestedEdit = SuggestedEditBase & SuggestionMessage; /** * The normalized version of a lint suggestion. */ -interface LintSuggestion { +export interface LintSuggestion { /** A short description. */ desc: string; @@ -904,7 +904,7 @@ export type EcmaVersion = * The type of JavaScript source code. * @deprecated Only supported in legacy eslintrc config format. */ -type JavaScriptSourceType = "script" | "module" | "commonjs"; +export type JavaScriptSourceType = "script" | "module" | "commonjs"; /** * Parser options. @@ -974,7 +974,7 @@ export interface EnvironmentConfig { /** * A configuration object that may have a `rules` block. */ -interface HasRules { +export interface HasRules { rules?: Partial | undefined; } @@ -983,7 +983,7 @@ interface HasRules { * * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/) */ -interface BaseConfig< +export interface BaseConfig< Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules, > extends HasRules {